[thelist] problem formatting ASP/Access WHERE statement
Dunstan Orchard
dunstan at 1976design.com
Fri Nov 22 07:43:01 CST 2002
Hi there,
I have an ASP page which, when loaded, includes an ArticleID value in the url:
http://207.17.209.3/perform/article.asp?ArticleID=63
This ArticleID is then used to lookup the correct article in an Access db:
--------------------------------
strQuery = "SELECT
ArticleID,ArticleTitle,ArticleFile,ArticleSummary,ArticleContent,ColumnName,Cur
rentIssue,AuthorID,FullName,IssueID,IssueFile,FutureIssue FROM ArticlesQuery
WHERE ArticleID = 'ArticleID'"
--------------------------------
But when I run this (and the db connection gubbins before it) I get the
following errors:
--------------------------------
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria
expression.
/perform/article.asp, line 16
--------------------------------
I don't understand in ASP how to format the WHERE bit of the query.
I've also tried:
--------------------------------
...FROM ArticlesQuery WHERE ArticleID = ::ArticleID::"
--------------------------------
but that gives the error:
--------------------------------
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in
query expression 'ArticleID = ::ArticleID::'.
/perform/article.asp, line 16
--------------------------------
Can anyone help me format this section correctly?
Many thanks - dunstan
---------------------------
Dorset, England
http://www.1976design.com/
http://www.orchard.it/
http://www.maccaws.org/
More information about the thelist
mailing list