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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...