Article View: comp.lang.basic.visual.misc
Article #434Re: Syntax Question?
From: David Wier
Date: Tue, 06 Apr 1999 00:00
Date: Tue, 06 Apr 1999 00:00
76 lines
3343 bytes
3343 bytes
What are you looking to find - an exact match or an approximate match on: 1. is art a variable or 2. is art three exact letters Basically, what is art? If it's a field name, that's even different than the two above and you are going in the wrong direction - in your select statement, where compares a fieldname (songs.artist) to whatever art is. So in that context, art should be exact text or a variable. sql="Select DISTINCT Songs.song from songs Where songs.artist Like '%art%'" The above statement will give you any artist with the letters 'art' somewhere it it - Like Bart, Art, Martin, etc. Notice the Percent signs instead of ampersands... If art is a variable, that's different. -- David Wier http://www.aspexpress.com http://www.augustwind.com Designer of the Best ASP Editor in the Galaxy Chad Gough wrote in message ... >Still having problems! > > sql = "SELECT DISTINCT songs.Song FROM songs WHERE songs.artist >='"&art&"'" >(quotes after songs.artist = are single, double, variable, double, single, >double) > >and i still get: >ADODB.Field error '800a0bcd' > >Either BOF or EOF is True, or the current record has been deleted; the >operation requested by the application requires a current record. > >/file.asp, line 52 > >If i use: ><%=art%> >anywhere else on the page, it displays the right info !?!? > >Ideas? > > > >David Wier <dwier@home.com> wrote in message >news:H7dO2.29152$SZ5.9745@news.rdc1.tx.home.com... >> I have a tutorial on using Quotes in ASP at my site...check it out. >> -- >> David Wier >> http://www.aspexpress.com >> http://www.augustwind.com >> Designer of the Best ASP Editor in the Galaxy >> >> Chad Gough wrote in message ... >> >I have a VB script in an ASP page running a query. >> > >> >The SQL code looks like: >> >sql = "SELECT DISTINCT songs.Song FROM songs WHERE songs.artist = >'????' >> " >> > >> >What is the syntax to put a variable where ???? is? >> >The query works fine if I replace ???? with a value from the database!?!? >> > >> >Any help would be appreciated. >> > >> >Thanks >> > >> > >> >> > >
Technical Details
Message-ID:
<1RfO2.29182$SZ5.9920@news.rdc1.tx.home.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<ambO2.5836$033.1763@news.rdc1.il.home.com> <H7dO2.29152$SZ5.9745@news.rdc1.tx.home.com> <NJeO2.5841$033.1778@news.rdc1.il.home.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 108db9,27ae79593ba8da5c X-Google-Attributes: gid108db9,public X-Google-Thread: 10ce47,27ae79593ba8da5c X-Google-Attributes: gid10ce47,public X-Google-Thread: 1477ed,27ae79593ba8da5c X-Google-Attributes: gid1477ed,public X-Google-Thread: 110e3b,27ae79593ba8da5c X-Google-Attributes: gid110e3b,public X-Google-Thread: fdea5,27ae79593ba8da5c X-Google-Attributes: gidfdea5,public From: "David Wier" <dwier@home.com> Subject: Re: Syntax Question? Date: 1999/04/06 Message-ID: <1RfO2.29182$SZ5.9920@news.rdc1.tx.home.com> X-Deja-AN: 463117498 References: <ambO2.5836$033.1763@news.rdc1.il.home.com> <H7dO2.29152$SZ5.9745@news.rdc1.tx.home.com> <NJeO2.5841$033.1778@news.rdc1.il.home.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 X-Complaints-To: abuse@home.net X-Trace: news.rdc1.tx.home.com 923371965 24.4.49.69 (Mon, 05 Apr 1999 21:12:45 PDT) Organization: @Home Network NNTP-Posting-Date: Mon, 05 Apr 1999 21:12:45 PDT Newsgroups: comp.lang.basic.visual.misc,cz.comp.microsoft.asp,fidonet.asp,microsoft.public.inetexplorer.ie5beta.programming.dhtml.authoring,microsoft.public.inetserver.iis.activeserverpages