“Data type mismatch in criteria expression.” Error

后端 未结 1 692
清歌不尽
清歌不尽 2020-12-22 09:45

I get a \"Data type mismatch in criteria expression.\" error when running this code on one database but it works perfectly fine on another database. When trying to copy the

相关标签:
1条回答
  • 2020-12-22 10:04

    With OleDb (as you are using) Criteria Mismatch Usually means that the data you are trying to put into the database can't be accepted because the database is expecting a different type of data. (i.e. the database expects an integer and you pass a double to it.) It can be a bit annoying but you'll need to double check all the datatypes of the columns in the database to make sure you are sending something it can handle.

    In this case... maybe the the database column of SecretaryUsername is not actually a string? That seems odd but it's been known to happen. Some DB designers will name a field like that even though it contains an integer (to match up with an autonumber) You'll have to look at the Databases's expected datatype to know for sure

    0 讨论(0)
提交回复
热议问题