| VB.net Insert Customer Code |
| Author |
Message |
|
|
| Posted : 2008-06-11 03:01:35 |
I'm not sure what I'm doing wrong here. I am trying to insert into the Quickbooks Customer file using your example person with with VB.NET:
Try
Dim cnIns As New OdbcConnection
cnIns.ConnectionString = ("DSN=HaneyOne")
Dim commIns As OdbcCommand
commIns = New OdbcCommand("Insert into Customer(Name,LastName,FirstName,BillAddressAddr1,BillAddressCity,BillAddressState,BillAddressPostalcode)Values('Zuniga, Daphne','Zuniga','Daphne','561 W 4th St.','Carlsbad','CA','92009'", cnIns)
cnIns.Open()
CommIns.ExecuteNonQuery()
cnIns.Close()
Catch ex As Exception
Me.lblInsMsg.Text = "Error: " & ex.ToString()
End Try
lblInsMsg.Text = "Insert Successful"
I am getting the error: ERROR [42000] [QODBC] Expected lexical element not found. What am I missing? |
|
|
|
|
|
| Posted : 2008-06-11 10:16:46 |
The values are missing the closing )
commIns = New OdbcCommand("Insert into Customer(Name,LastName,FirstName,BillAddressAddr1,BillAddressCity,BillAddressState,BillAddressPostalcode)Values('Zuniga, Daphne','Zuniga','Daphne','561 W 4th St.','Carlsbad','CA','92009')", cnIns) |
|
|
|
|
|
| Posted : 2008-06-12 00:16:09 |
|
|
|
|