newprogrammer999
Programmer
Hi everyone,
I'm wondering if anyone can help me with this problem i have when I try to insert values in to an Access table from VB. Here is the relevant code:
Dim businessname As String
Dim firstname As String
businessname = txtBusinessName.Text
firstname = txtFirstName.Text
Dim sql As String
Dim oConn As New ADODB.Connection
oConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=H:\project\April08\Customerdb.mdb;Persist Security Info=False"
oConn.Open
sql = "INSERT INTO tblCustomer(ClientBusinessName, FirstName) VALUES (businessname, firstname)"
oConn.Execute (sql)
When I try to do this I get an error saying
"No value given for one or more required parameters" and the insert does not work. I have tried numerous solutions to this simple problem but just can't seem to find the answer. Any help would be greatly appreciated.
benny
I'm wondering if anyone can help me with this problem i have when I try to insert values in to an Access table from VB. Here is the relevant code:
Dim businessname As String
Dim firstname As String
businessname = txtBusinessName.Text
firstname = txtFirstName.Text
Dim sql As String
Dim oConn As New ADODB.Connection
oConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=H:\project\April08\Customerdb.mdb;Persist Security Info=False"
oConn.Open
sql = "INSERT INTO tblCustomer(ClientBusinessName, FirstName) VALUES (businessname, firstname)"
oConn.Execute (sql)
When I try to do this I get an error saying
"No value given for one or more required parameters" and the insert does not work. I have tried numerous solutions to this simple problem but just can't seem to find the answer. Any help would be greatly appreciated.
benny