the code is below.
the system said me that the insert into sql syntax error
any solutions?
Dim dbProvider As String
Dim dbSource As String
Dim constr As New OleDb.OleDbConnection
Dim sql As String
Dim ds As New DataSet
Dim da As OleDb.OleDbDataAdapter
form load code:
dbProvider = "PROVIDER=Microsoft.Jet.OLEDB.4.0;"
dbSource = "Data Source = pj.mdb"
constr.ConnectionString = dbProvider & dbSource
sql = "select * from information"
da = New OleDb.OleDbDataAdapter(sql, constr)
da.Fill(ds, "bking")
button click event :
Dim cb As New OleDb.OleDbCommandBuilder(da)
Dim dsNewRow As DataRow
dsNewRow = ds.Tables("bking").NewRow()
dsNewRow.Item(0) = "1231231"
ds.Tables("bking").Rows.Add(dsNewRow)
da.Update(ds, "bking")
MsgBox("New Record added to the Database")