Jump to content

Data type mismatch?


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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...