Access Date/Time and DateTime.now - Data type mismatch in criteria November 18 2005
I was recently receiving “Data type mismatch in criteria expression” errors when trying to insert a record into an Access database with a Date/Time field.
It seems as though if you assign the Datetime.now to a class variable and put the class variable into the SQL Parameter Add statement all will be well.
If you try and put the DateTime.now directly into the SQL Parameter Add statement, you will get the mismatch error.
For the Access DB, it appears you need to use the following:
DateTime.Now.ToOADate
More wasted hours
- Posted in : .NET
- Author : site admin

Comments
Sorry comments are closed for this entry