all groups > inetserver asp db > october 2003 >
You're in the

inetserver asp db

group:

error when submit new DATE records


error when submit new DATE records Barbaraa
10/27/2003 9:13:52 AM
inetserver asp db:
I have to insert new records by a add_form.asp. the
database is access. When I submit a record,
if the DATE textbox is empty, I have an error because it
appear access doesn't want empty record in date field!!
I said "yes" to allow null in table properties
Can someone help me?
this is the error:

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

thanks,

Re: error when submit new DATE records Aaron Bertrand - MVP
10/27/2003 12:25:43 PM
Null and "" and "##" are not the same thing!

Maybe you should say this:

if request.form("dateTextBox") = "" then
dt = "NULL"
else
dt = "#" & request.form("dateTextBox") & "#"
end if
sql = "UPDATE table SET dtColumn = " & dt & " WHERE ... "



[quoted text, click to view]

AddThis Social Bookmark Button