🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.databases.ms-access
Article #537

SQL Select query for Access2000

#537
From: Christo du Toit
Date: Thu, 24 May 2001 22:41
30 lines
2100 bytes
Hi

I am writing an ASP query to retrieve data from an access database file

The ASP query looks as follows:
   <form
      METHOD="GET" ACTION="SMS%20Word%20Query.asp">
      <p>Search for: <input TYPE="Text" NAME="[Search for:]" size="20"></p>
      <p><input TYPE="Submit" VALUE="Run Query"> </p>
    </form>

[The search for:] variable must then be handed over to another ASP file that
will do the query.
The query looks like this:

    sql = "SELECT SMS.Date, SMS.SMS FROM SMS WHERE (((SMS.SMS)     Like
'*'+" & Request.QueryString("[Searc") & "h for:]+'*')) "

The sql= "SELECT... was generated by access 2000 but when i try it out on
the webserver I get the following error:

    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
    [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing
operator)     in query expression '(((SMS.SMS) Like '*'+h for:]+'*'))'.
    /kiewiet/DailySMS/SMS Word Query.asp, line 31

Can anyone maybe help me out with the correct syntax?

Thanks
Christo
Technical Details
Message-ID: <9ek2dr$kkd$1@ctb-nnrp2.saix.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!btnet-peer1!btnet-peer0!btnet!ctb-nntp1.saix.net!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: ff0ac,20874c96d58fbea,start
X-Google-Attributes: gidff0ac,public
X-Google-Thread: 10f31b,20874c96d58fbea,start
X-Google-Attributes: gid10f31b,public
X-Google-ArrivalTime: 2001-05-24 15:36:54 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!btnet-peer1!btnet-peer0!btnet!ctb-nntp1.saix.net!not-for-mail
From: "Christo du Toit" <cdutoit@ananzi.co.za>
Newsgroups: comp.databases.ms-access,free.database.access
Subject: SQL Select query for Access2000
Date: Fri, 25 May 2001 00:41:14 +0200
Organization: The South African Internet Exchange
Lines: 34
Message-ID: <9ek2dr$kkd$1@ctb-nnrp2.saix.net>
NNTP-Posting-Host: bfn53-02-p153.fs.saix.net
X-Trace: ctb-nnrp2.saix.net 990743803 21133 155.239.102.153 (24 May 2001 22:36:43 GMT)
X-Complaints-To: abuse@saix.net
NNTP-Posting-Date: 24 May 2001 22:36:43 GMT
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400