excel - What is wrong with this query? i am using vb script to insert data to access database -
i trying insert data microsoft access database these queries wrong seems. whenever run query syntax error near insert statements.
following queries; can 1 tell me correct syntax?
first query :
strst = "use employee_data insert employee_data (loginid,fname,lname,number) values (""" & user & """,""" & firstname & """,""" & lastname & """, """ & phonenumber & """)"
second query :
strst = "use employee_data insert employee_data (loginid,fname,lname,number) values (""user"", ""firstname"", ""lastname"", ""phonenumber"")"
third query :
dbs.execute " insert employees " _ & "(userid, fname, lname, number) values " _ & "(user, firstname, lastname, phonenumber);"
fourth query :
strst = "insert employee_data (loginid,fname,lname,number) values ([" & user & "], [" &firstname& "], [" & lastname & "], [" &phonenumber & "]);"
fifth query :
strst = "use employee_data insert employee_data (loginid,fname,lname,number) values ([user],[firstname],[lastname],[phonenumber])"
if recall correctly, access should still okay single quotes:
strst = "use employee_data insert employee_data (loginid,fname,lname,number) values ('" & user & "','" & firstname & "','" & lastname & "', '" & phonenumber & "')"
Comments
Post a Comment