Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data type mismatch error...can't solve this

Status
Not open for further replies.

snowboardr

Programmer
Feb 22, 2002
1,401
PH
Not sure why im getting this!
------------------------------

Microsoft JET Database Engine error '80040e07'

Data type mismatch in criteria expression.

/duck/Default.asp, line 564 ---> rs = my_conn.Execute(StrSQL)


Code:
<%
ConnString = &quot;Provider=Microsoft.Jet.OLEDB.4.0; Data Source=&quot; & Server.MapPath(&quot;database.mdb&quot;)

set my_conn= Server.CreateObject(&quot;ADODB.Connection&quot;)
set rs = Server.CreateObject(&quot;ADODB.RecordSet&quot;)

my_conn.Open ConnString

Smid = Request.Querystring(&quot;mID&quot;)

StrSQL = &quot;SELECT * FROM specs WHERE mID=&quot; & &quot;'&quot; & Smid & &quot;'&quot;

rs = my_conn.Execute(StrSQL)

model_name = rs(&quot;model_name&quot;)

Response.Write(model_name)
%>
 
Is the data type for mID numeric or varchar?

If it is numeric, don't use single quotes around the value.

The easiest way to debug SQL statements is to write them to the screen, then run them in your database program... you sometimes get more useful error messages there.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top