With what you have, you're trying to insert the literal text, "MaintDate."
You want to insert a date, i.e.
Conn.Execute "INSERT INTO PrinterMaintenance (MaintDate, SA, Maintenance,
PrinterName, UserName) VALUES (#" & Date & "#,'SA'......)"
Also, do you mean to insert the literal text of SA, Maintenance,
Printername, etc.? Or are they variables? If those are variables in your
code, they are not going to be evaluated when you execute your INSERT. All
you'll see is the actual literal text, MaintDate, SA, etc. Remember, you're
just building a string here, so if you want to concatenate variable values,
you have to do just that - concatenate the values.
sSQL = "INSERT INTO.... VALUES (#" & Date & "#,'" & SA & "','" & Maintenance
& "','" & PrinterName & "','" & Username & "')"
Response.Write sSQL
Ray at home
"dthmtlgod" <do*************@netzero.net> wrote in message
news:ui**************@TK2MSFTNGP10.phx.gbl...
I am trying to insert a date into a date field through my website. The
date
is pre-populated with todays date. I am getting a type mismatch error.
The
Access DB is setup as a Date/Time Short Date field.
Here is the SQL string. Any ideas?
Conn.execute ("INSERT INTO PrinterMaintenance (MaintDate, SA, Maintenance,
PrinterName, UserName) VALUES ('MaintDate', 'SA', 'Maintenance',
'PrinterName', 'UserName')")