VIPER5646 25 Junior Poster in Training

HI v5prgrmr

I tried your QRY and now I get an error.
The error is ( Missing Semicolon at the end oof the SQL statement.
I have tried to place a Semicolon at the end and in diferent places in the SQL but I continue to get the same error.
This is my updated SQL statement.

Dim mysql As String = "insert into Customer_tbl values('First Name','Last Name') values ('John','Unknown');"

VIPER5646 25 Junior Poster in Training

Are you using ADO to connect to the database ?

No i'm using OLEDB

VIPER5646 25 Junior Poster in Training

i don't think that is VB 6.0 code.

if vb 6.0 then try this

Dim Sql As String = "insert into Customer_tbl (Custsql )values '" & txtFirstName.Text & "','" & txtLastName.Text & "')"
con.begintrans          'con-----ADODB connection object.
con.execute sql
con.committrans

thanks for your reply.
when I try the coed I get an error that execute and committrans are not members of the OLEDB.
I'm using Acess 2007 as a Database. Hope this helps.
Thanks

VIPER5646 25 Junior Poster in Training

I been searching for days for a sulotion but can't seem to find one.
The coed that I have does not give me an error but it does not save anything on the table either '
Can someone help me find what I'm missing?
this is my coed

Dim mycon As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\DEsign.accdb"
        Dim customer As String = "select * from Customer_tbl"
        Dim Notes As String = "select * from Notes_tbl"
        Dim con As New OleDb.OleDbConnection(mycon)
        Dim comCustomer As New OleDb.OleDbCommand(customer, con)
        Dim comdNotes As New OleDb.OleDbCommand(Notes, con)
        Dim Custsql As String = "first name,Last Name"
        Dim Sql As String = "insert into Customer_tbl (Custsql )values '" & txtFirstName.Text & "','" & txtLastName.Text & "')"
        comCustomer = New OleDb.OleDbCommand(Sql, con)
        
        con.Open()
        comCustomer.ExecuteNonQuery()
       comCustomer.Dispose()
        con.Close()

Thank you
Viper