[thelist] problem formatting ASP/Access WHERE statement

Anthony Johnston . Antix tech at antix.co.uk
Fri Nov 22 07:50:01 CST 2002


try

"SELECT
ArticleID,ArticleTitle,ArticleFile,ArticleSummary,ArticleContent,Co
lumnName,Cur
rentIssue,AuthorID,FullName,IssueID,IssueFile,FutureIssue FROM
ArticlesQuery
WHERE ArticleID = " & request.queryString("ArticleID")

Ant.

>-----Original Message-----
>From: thelist-admin at lists.evolt.org
>[mailto:thelist-admin at lists.evolt.org]On Behalf Of Dunstan Orchard
>Sent: 22 November 2002 13:43
>To: thelist at lists.evolt.org
>Subject: [thelist] problem formatting ASP/Access WHERE statement
>
>
>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,Co
>lumnName,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/
>--
>* * Please support the community that supports you.  * *
>http://evolt.org/help_support_evolt/
>
>For unsubscribe and other options, including the Tip Harvester
>and archives of thelist go to: http://lists.evolt.org
>Workers of the Web, evolt !



More information about the thelist mailing list