Forum Moderators: open

Message Too Old, No Replies

criteria mismatch

         

Blelisa

8:12 pm on Sep 22, 2005 (gmt 0)

10+ Year Member



I hit yet another snag, Can anyone help me. I keep getting an error saying:
Microsoft JET Database Engine error '80040e07'

Data type mismatch in criteria expression.

/templates/details.asp, line 13

I have a page which displays my records from my database, then each records Tnum field is clickable that takes it to my details page which will show only that record. My code for this is:
<a href="details.asp?ID=<%= objRS("Tnum")%>"><%= objRS("Tnum") %></a>

The code on my details.asp page is:
<%
Dim ID
ID=Request.QueryString("ID")

set connection=Server.CreateObject("ADODB.Connection")
connection.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &_
server.MapPath("/templates/test/developers.mdb")
connection.Open

strSQL="SELECT * FROM Bug WHERE Tnum='" & ID & "'"

set objRS = connection.Execute (strSQL)

if (objRS.BOF and objRS.EOF) then
response.write "No records found"
response.end
End if
%>

My database Tnum is listed as a number.

I can't see what is not matching. Any help is greatly appreciated!

Easy_Coder

9:13 pm on Sep 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Tnum = Tnum<int> at the database level?

If it's an int then don't pass ID as a string
strSQL="SELECT * FROM Bug WHERE Tnum=" & ID

Blelisa

9:19 pm on Sep 22, 2005 (gmt 0)

10+ Year Member



Thanks!