Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

new record access tables

Status
Not open for further replies.

pds8475

Technical User
Apr 27, 2007
8
GB
hi im using the code below to try and add a new user name and password to a access table but when i debug the program it says that there is a syntax error in the insert into statment at the da.Update(ds, "un") statment


Private Sub ButtOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtOK.Click
If inc <> 1 Then

Dim cb As New OleDb.OleDbCommandBuilder(da)
Dim dsNewRow As DataRow

dsNewRow = ds.Tables("un").NewRow()
dsNewRow.Item("username") = username.Text
dsNewRow.Item("Password") = password.Text


ds.Tables("un").Rows.Add(dsNewRow)

da.Update(ds, "un")

MsgBox("New Record added to the Database")



End If
 
What is the value of da.InsertCommand.CommandText as this is the SQL that has the syntax error?

Bob Boffin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top