Click to See Complete Forum and Search --> : Date/Time - Microsoft OLE DB Provider for ODBC Drivers error '80040e07'


theflyingminst
02-16-2009, 12:48 AM
Hi I am getting this error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.

This is my SQL statement (goDate is in 2/15/2009 format. I'm thinking that might be my problem?.. It IS a date/time field in Access).

SQL = "insert into calendar (event, cal_date, username) values " & _
"('" & new_event & "','" & goDate & "','" & my_usernm & "');"


Thank you

chazzy
02-16-2009, 07:34 PM
it is. you have to use something to convert the string (since SQL is a string when you build this variable it becomes a string) to a date. Try using CDate.

Charles
02-16-2009, 07:34 PM
Give #2/15/2009# a try.

theflyingminst
02-16-2009, 08:23 PM
Hi, #2/15/2009# worked. Thank you!

vinothvijay
03-14-2011, 06:39 AM
it may be difference in the date option, for Eg: You have created a database in UK server and if you copy the database in you local and try to update this thing it wont work because UK/US date format is totally different when compared to Indian date format
For India 25/12/2011
For UK it 12/25/2011
so when you are updating in the database it wont accept you have change the format.