P
Paul
I'm trying to update a Microsoft Access database. I can successfully
read from the database and submit a command to DELETE all records from
a table. Now I'm trying to add records to the table that I just
cleared. Below is the code:
myConnection = New
OleDb.OleDbConnection(accessConnectionStringConstant & accessMdb)
myCommand.Connection = myConnection
myCommand.CommandText = SqlString
myCommand.CommandType = CommandType.Text
myCommand.CommandTimeout = 420
myDataAdapter.SelectCommand = myCommand
Dim myCommandBuilder As New
OleDb.OleDbCommandBuilder(myDataAdapter)
myConnection.Open()
myDataAdapter.Update(dst.Tables(TableName))
This code is part of a Sub that receives the correct SELECT statement
in the "SqlString" parameter. After the
Dim myCommandBuilder As New
OleDb.OleDbCommandBuilder(myDataAdapter)
statement, the INSERT, UPDATE and DELETE statements are nothing in
myDataAdapter. So when the
myDataAdapter.Update(dst.Tables(TableName))
statement runs, an exception is thrown stating that the INSERT INTO
statement is invalid. What am I doing wrong?
read from the database and submit a command to DELETE all records from
a table. Now I'm trying to add records to the table that I just
cleared. Below is the code:
myConnection = New
OleDb.OleDbConnection(accessConnectionStringConstant & accessMdb)
myCommand.Connection = myConnection
myCommand.CommandText = SqlString
myCommand.CommandType = CommandType.Text
myCommand.CommandTimeout = 420
myDataAdapter.SelectCommand = myCommand
Dim myCommandBuilder As New
OleDb.OleDbCommandBuilder(myDataAdapter)
myConnection.Open()
myDataAdapter.Update(dst.Tables(TableName))
This code is part of a Sub that receives the correct SELECT statement
in the "SqlString" parameter. After the
Dim myCommandBuilder As New
OleDb.OleDbCommandBuilder(myDataAdapter)
statement, the INSERT, UPDATE and DELETE statements are nothing in
myDataAdapter. So when the
myDataAdapter.Update(dst.Tables(TableName))
statement runs, an exception is thrown stating that the INSERT INTO
statement is invalid. What am I doing wrong?