T
Thorsten Tarrach
Hallo,
The SQL Statements the CommandBuilder creates never work. (Wrong INSERT INTO
....)
To test this I created a new Access DB and a new application.
I used the wizzard in the IDE and here is the result:
---------
'OleDbSelectCommand1
'
Me.OleDbSelectCommand1.CommandText = "SELECT ID1, Tabelle1, Tabelle2 FROM
Tab1"
Me.OleDbSelectCommand1.Connection = Me.OleDbConnection1
'
'OleDbInsertCommand1
'
Me.OleDbInsertCommand1.CommandText = "INSERT INTO Tab1(Tabelle1, Tabelle2)
VALUES (?, ?)"
Me.OleDbInsertCommand1.Connection = Me.OleDbConnection1
Me.OleDbInsertCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Tabelle1",
System.Data.OleDb.OleDbType.VarChar, 50, "Tabelle1"))
Me.OleDbInsertCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Tabelle2",
System.Data.OleDb.OleDbType.VarChar, 50, "Tabelle2"))
The SQL Statements the CommandBuilder creates never work. (Wrong INSERT INTO
....)
To test this I created a new Access DB and a new application.
I used the wizzard in the IDE and here is the result:
---------
'OleDbSelectCommand1
'
Me.OleDbSelectCommand1.CommandText = "SELECT ID1, Tabelle1, Tabelle2 FROM
Tab1"
Me.OleDbSelectCommand1.Connection = Me.OleDbConnection1
'
'OleDbInsertCommand1
'
Me.OleDbInsertCommand1.CommandText = "INSERT INTO Tab1(Tabelle1, Tabelle2)
VALUES (?, ?)"
Me.OleDbInsertCommand1.Connection = Me.OleDbConnection1
Me.OleDbInsertCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Tabelle1",
System.Data.OleDb.OleDbType.VarChar, 50, "Tabelle1"))
Me.OleDbInsertCommand1.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Tabelle2",
System.Data.OleDb.OleDbType.VarChar, 50, "Tabelle2"))