patrickstrijdonck
Programmer
Hello,
Im trying to setup a one way sync between 2 different MS ACCESS files.
The first SQL query runs fine, If I add a record, it gets deleted.
The problem occurs at the second SQL query.
the error is: Invalid Argument.
Am I missing something? Please help.
Im trying to setup a one way sync between 2 different MS ACCESS files.
The first SQL query runs fine, If I add a record, it gets deleted.
The problem occurs at the second SQL query.
the error is: Invalid Argument.
Code:
selectSQLL = "INSERT INTO table1 SELECT * FROM [MS Access;DATABASE=" + Properties.Settings.Default.ConnectionString1 + ";].[table1]";
Code:
//Delete all information from Stores Table.
string selectSQLL1;
string cmdstrr1 = Properties.Settings.Default.IT4STOCKConnectionString;
selectSQLL1 = "DELETE * FROM table1";
OleDbConnection conn1 = new OleDbConnection(cmdstrr1);
OleDbCommand comn1 = new OleDbCommand(selectSQLL1, conn1);
conn1.Open();
comn1.ExecuteScalar();
conn1.Close();
//Copy all Data from Stores and put it into database
string selectSQLL;
string cmdstrr = Properties.Settings.Default.IT4STOCKConnectionString;
selectSQLL = "INSERT INTO table1 SELECT * FROM [MS Access;DATABASE=" + Properties.Settings.Default.ConnectionString1 + ";].[table1]";
OleDbConnection conn = new OleDbConnection(cmdstrr);
OleDbCommand comn = new OleDbCommand(selectSQLL, conn);
conn.Open();
comn.ExecuteReader();
conn.Close();
Am I missing something? Please help.