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


theflyingminst
02-15-2009, 11:48 PM
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, 06: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, 06:34 PM
Give #2/15/2009# a try.

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