PDA

View Full Version : help on error message


dawilis
09-01-2002, 01:49 AM
What is going wrong here

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
/class/showvoucher.asp, line 15


7 set RSVoucher = Server.CreateObject("ADODB.Recordset")
8 'RSVoucher.ActiveConnection = MM_class_STRING
9 RSvoucher.ActiveConnection = dbdir
10 RSVoucher.Source = "SELECT * FROM voucher WHERE CatID ='" & Request.QueryString("cat") & "'"
11
12 RSVoucher.CursorType = 0
13 RSVoucher.CursorLocation = 2
14 RSVoucher.LockType = 3
15 RSVoucher.Open()
16 RSVoucher_numRows = 0
17 %>

whammy
09-01-2002, 02:50 AM
Try losing the single quotes around your variable and see if that helps. Perhaps what you're matching in the db is an integer?

Or try

CInt(Request.QueryString("cat") )

Just a thought.

dawilis
09-01-2002, 03:22 AM
Hi ho whammy yes thats what I came up with also Do you remember the last POst I made re the select statment, the last message we had was a guy suggesting a relationship between 2 tables, I saw the advantages of that and implemented it however it spoiled the display page, What I think is happenimg is Im sending the ID number via the URl and using request.querystring to get it as you have obviously determined by suggesting the CINT() function or drop the single quotes And viola dada
its fixed ,
you Bloody genuis
regards
Daryl

whammy
09-01-2002, 04:19 AM
I'm glad I could help. :D