I cannot believe how loooooong i have been searching the internet for this. However i have a form that i have created in Visual studio 2010.
I have 3 text boxes for FIRST NAME, LAST NAME and NOTES. I have 1 button to submit data.
When i click the button to submit the data, i would like for the data to insert into the database.
I can deal with validation, viewing the data and making it fancy later. For now, i just need the code behind the button to insert it into an Access 2010 database.
Please any help for a newbie.
Thank you in advance
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
I find that the hardest part is keeping all the extra double quotes straight.