Inseting DateTime into MSAccess

  • Thread starter Thread starter tmarunkumarit
  • Start date Start date
T

tmarunkumarit

I want to insert datetime values into msaccess using asp.net by vb.. Am getting error that Syntax Error in INSERT INTO statement...

My query is
strSQL="insert into group0 (name,addressline1,addressline2,landmark,city,state,pincode,telephone1,telephone2,altcontactno,businesscategory,product,category,date) values('" & txtname.text & "','" & txtadds1.text & "','" & txtadds2.text & "','" & txtland.text & "', '" & txtcity.text & "', '" & txtstate.text & "' , '" & txtpin.text & "','" & txttel1.text & "','" & txttel2.text & "','" & txtmob.text & "','" & txtbus.text & "','" & txtpro.text & "','" & txtcat.text & "','" & now & "')"

please help me...
 
Hi,

The way you do it, you try to insert the string "now" into the database. But
you must use the ACCESS-Function now(), so the part must look like:

Instead of:
& txtcat.text & "','" & now & "')"
like that:
& txtcat.text & "', now())"

Greetings,
Dirk
 
Back
Top