Jump to content

Data type mismatch?


narrator

Recommended Posts

Hi, could someone please help with the following error:Microsoft JET Database Engine error '80040e07'Data type mismatch in criteria expression./mytest.asp, line 23 In my code below, I need to do 2 things- Use a variable passed from a form to choose the record ID, hence recid- Create a variable for the field data myTxtThe code works when I substitute 3 for recid in the sql line.recid=3set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "myDBpath"set rs=Server.CreateObject("ADODB.recordset")sql="SELECT ID, myTxt FROM myTable WHERE ID=recid" <This is the line the error refers to.rs.Open sql, connjobid=rs.fields("ID")jobtxt=rs.fields("myTxt")response.write(jobid & "<br>" & jobtxt)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...