Query help on Access text field

48 views
Skip to first unread message

CD

unread,
Mar 21, 2003, 4:08:59 PM3/21/03
to
I have the following code below to hit an Access2002 db

strDriver = Request("driver")

'Response.Write strDriver

Set rsResults = Server.CreateObject("ADODB.Recordset")

strSQL = "SELECT tblResults.* "
strSQL = strSQL & "FROM tblResults "
strSQL = strSQL & "WHERE tblResults.Driver like " & strDriver & " ;"

rsResults.CursorType = 3

Line 58>>> rsResults.Open strSQL, adoCon


I get the folowing error when I do>> RaceResult.asp?driver=amiller

Error Type:
Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.
/res/RaceResult.asp, line 58

The field in the db is a text field.......I am confused, if I change the
coloumn to my RaceID column and pass a value it works.


Phillip Windell

unread,
Mar 21, 2003, 4:27:06 PM3/21/03
to
"CD" <mcd...@hotmail.nospam.com> wrote in message
news:eXntL4#7CHA...@TK2MSFTNGP11.phx.gbl...

Does strDriver end up containing anything? Add this line after the
"Response" line.

Response.Write strDriver
Response.end

If it does show containing data then....
What about changing this...

> strDriver = Request("driver")

...to this...

strDriver = Request.Querystring("driver")


--

Phillip Windell
pwin...@wandtv.com
WAND-TV (ABC Affiliate)
www.wandtv.com


CD

unread,
Mar 21, 2003, 4:37:49 PM3/21/03
to
Thanks for the help.

both ways show data but same error when i take out response.end

Error Type:
Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.

/res/RaceResult.asp, line 61

line>>rsResults.Open strSQL, adoCon

This is strange,,,,I feel stupid....if I use a column that has a number it
works


"Phillip Windell" <pwin...@wandtv.com> wrote in message
news:eRFXkB$7CHA...@TK2MSFTNGP11.phx.gbl...

Bob Barrows

unread,
Mar 21, 2003, 4:56:27 PM3/21/03
to
Delimiters

Create the query in the Access Query Builder then switch to SQL View. Does
it look like this:
WHERE tblResults.Driver like amiller

or like this:
WHERE tblResults.Driver like "amiller"

I bet it looks like the second one. String data needs to be delimited by
quotes. You need to make your query in ASP look like this. BTW, why are you
using Like? Without wildcards, you may as well use the more efficient =.

I like to avoid this delimiter issue by using saved parameter queries.
Create a saved query in Access with this SQL:
SELECT tblResults.* FROM tblResults
WHERE tblResults.Driver = [pDriver]

Save the query as GetResults. In ASP, do this:

Set rsResults = server.createobject("adodb.recordset")
adoCon.GetResults strDriver, rsResults

HTH,
Bob Barrows

"CD" <mcd...@hotmail.nospam.com> wrote in message

news:eSIMPI$7CHA...@TK2MSFTNGP12.phx.gbl...

CD

unread,
Mar 24, 2003, 8:54:06 AM3/24/03
to
Thanks for the replies. I got past this hurdle.


"Bob Barrows" <reb_...@yahoo.com> wrote in message
news:ukS$6S$7CHA...@TK2MSFTNGP11.phx.gbl...

Message has been deleted
Message has been deleted

kaush...@gmail.com

unread,
Oct 10, 2012, 6:21:50 PM10/10/12
to
I am firing this query in vb6 and my database is in MS Access:

select count(plate_no) from INFO where date_time between #" & Form3.Text & "# and #" & Form3.Text & "#

It is not restricting my count to the range rather it is giving the count of all the rows in the table

what do i need to do
Reply all
Reply to author
Forward
0 new messages