Jump to content

Data type mismatch in criteria expression.


robokopf

Recommended Posts

Guys I'm having a bit of a problem with my ASP project. I get the data type mismatch error when I'm trying to edit data on my Access database on line 42.

strSQL = "SELECT * FROM project_package WHERE package_id= '"& int_packageid &"'"//Line 42 hereobjRS.Open strSQL, objConn,1,2

I think it's somewhat related to Access data type as well. package_id is an auto generated autonumber.This is how I initialize the package_id variable

dim int_packageidint_packageid = CInt (request.form("package_id"))

Apart from autonumber, I also used memo data type on Access database, but I think that shouldn't be a problem right? Is there something wrong with the codings? Should I different conversion function or something? Thanks in advance

Link to comment
Share on other sites

Wait - do you have an autonumber memo column? If you're using autonumber then the column needs to be numeric, like an integer. Then when you have that, in the query remove the quotes around the value, if you quote the value then it thinks you're using a string instead of a number (which is probably why it's saying there's a type mismatch).

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...