help with vb.net and ms access database
Posted on 2007-04-01
I have a serious brain block going on and I think I have turned this piece of code into one big disaster, I have a couple of variables that I want to insert into an ms access table and I am at a mind block. Below is my code. May be totally wrong, partly correct, not sure. All variables are strings.
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\emp.mdb;")
str = "insert into table1 (sid, lname, fname) values(" & ("sid") & ",'" & ("lname") & "','" & ("fname") & "')"
cmd = New OleDbCommand(str, cn)
Cmd.CommandText = str