Article View: comp.databases.ms-access
Article #538Re: SQL Select query for Access2000
From: Bruce Dodds
Date: Fri, 25 May 2001 21:12
Date: Fri, 25 May 2001 21:12
46 lines
2664 bytes
2664 bytes
Christo-
Try this:
sql = "SELECT SMS.Date, SMS.SMS FROM SMS WHERE (((SMS.SMS) Like '*"
+ Request.QueryString("[Search for:]") + "*'))"
I am not an ASP expert, but see how it goes. It looks as though part of
the problem at least is that your close quotes are in the wrong spot.
Good luck!
Bruce
Christo du Toit wrote:
>
> 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:
<3B0EC9F2.6AA6F376@mediaone.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!chnws02.mediaone.net!chnws06.ne.mediaone.net!24.128.8.202!typhoon.ne.mediaone.net.POSTED!not-for-mailReferences:
<9ek2dr$kkd$1@ctb-nnrp2.saix.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ff0ac,20874c96d58fbea X-Google-Attributes: gidff0ac,public X-Google-Thread: 10f31b,20874c96d58fbea X-Google-Attributes: gid10f31b,public X-Google-ArrivalTime: 2001-05-25 14:12:08 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!chnws02.mediaone.net!chnws06.ne.mediaone.net!24.128.8.202!typhoon.ne.mediaone.net.POSTED!not-for-mail Message-ID: <3B0EC9F2.6AA6F376@mediaone.net> From: Bruce Dodds <brucedodds@mediaone.net> Reply-To: brucedodds@mediaone.net Organization: MediaOne Express X-Mailer: Mozilla 4.72 [en]C-MOENE (Win95; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.databases.ms-access,free.database.access Subject: Re: SQL Select query for Access2000 References: <9ek2dr$kkd$1@ctb-nnrp2.saix.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 46 Date: Fri, 25 May 2001 21:12:07 GMT NNTP-Posting-Host: 65.96.232.49 X-Complaints-To: abuse@mediaone.net X-Trace: typhoon.ne.mediaone.net 990825127 65.96.232.49 (Fri, 25 May 2001 17:12:07 EDT) NNTP-Posting-Date: Fri, 25 May 2001 17:12:07 EDT