The actual syntax of the SQL query is
INSERT INTO table (col1name,col2name,...) VALUES(val1,val2,...)
An actual example would be
insert into mytable (first_name,last_name,notes) values("john","smith","heck of a nice guy");
with table named "mytable". An example in VB would be
firstname = "John"
lastname = "Smith"
notes = "a heck of a nice guy"
table = "mytable"
query = "insert into " & table & " (first_name,last_name,notes) values(""" & firstname & """,""" & lastname & """,""" & notes & """)"
if your connection object is named "con" then execute the query by
con.Execute(query)
I find that the hardest part is keeping all the extra double quotes straight.
Reverend Jim
Illigitimae non carborundum
3,740 posts since Aug 2010
Reputation Points: 585
Solved Threads: 469
Skill Endorsements: 33