Sunday, November 14, 2010

How do you add rows to an access database through vb 2005 using OleDb?

How does one add rows to an external database using visual basic 2005? add.rows? insert? .fill??? PLEASE HELP!!! an example would be helpful!How do you add rows to an access database through vb 2005 using OleDb?
take 3 text box.

imports system.data.oledb

dim cn as oledbconnection

dim cmd as oledbcommand

dim q as string



q=';insert into tablename values(@value1,@value2,@value3)

cn=new oledbconnection(';provider=microsoft.jet.鈥?source= path %26amp; name of your database;';)

cn.open

cmd=new oledbcommand(q,cn)

with cmd.parameters

.addwithvalues(';@value1';,textbox1.text)

.addwithvalues(';@value2';,textbox2.text鈥?br>
.addwithvalues(';@value3';,textbox2.text鈥?br>
end with

cmd.execute nonquery



Any problem ask
  • common name given to
  • No comments:

    Post a Comment