Using the ODBC driver, I can read the table just fine, but when I try to
insert using either of the following functions, I get an error message that
the field 'REF#' (this is the actual field name) was not found.
Option1:
private void btnAdd_Click(object sender, EventArgs e)
{
OdbcConnection myConnection = new
OdbcConnection("Driver={Microsoft Paradox Driver (*.db
)};DriverID=538;Fil=Paradox 5.X;DefaultDir=\\\\1-ttcf-fs02\\sharedfiles\\CSS
Facility Data\\Reference Log;Dbq=\\\\1-ttcf-fs02\\sharedfiles\\CSS Facility
Data\\Reference Log;CollatingSequence=ASCII");
String sql = "insert into sp_refer_log ([Ref#]) values
('0000-2009-1203-003')";
OdbcCommand cmd = new OdbcCommand(sql, myConnection);
myConnection.Open();
cmd.Prepare();
cmd.ExecuteNonQuery();
myConnection.Close();
}
Option 2:
private void btnAdd_Click(object sender, EventArgs e)
{
OdbcConnection myConnection = new
OdbcConnection("Driver={Microsoft Paradox Driver (*.db
)};DriverID=538;Fil=Paradox 5.X;DefaultDir=\\\\1-ttcf-fs02\\sharedfiles\\CSS
Facility Data\\Reference Log;Dbq=\\\\1-ttcf-fs02\\sharedfiles\\CSS Facility
Data\\Reference Log;CollatingSequence=ASCII");
String sql = "insert into sp_refer_log ('Ref#') values
('0000-2009-1203-003')";
OdbcCommand cmd = new OdbcCommand(sql, myConnection);
myConnection.Open();
cmd.Prepare();
cmd.ExecuteNonQuery();
myConnection.Close();
}
Option 3:
private void btnAdd_Click(object sender, EventArgs e)
{
OdbcConnection myConnection = new
OdbcConnection("Driver={Microsoft Paradox Driver (*.db
)};DriverID=538;Fil=Paradox 5.X;DefaultDir=\\\\1-ttcf-fs02\\sharedfiles\\CSS
Facility Data\\Reference Log;Dbq=\\\\1-ttcf-fs02\\sharedfiles\\CSS Facility
Data\\Reference Log;CollatingSequence=ASCII");
String sql = "insert into sp_refer_log values
('0000-2009-1203-003','ponder','123456','12/03/2009','Test Loc','Test
Incident','Loc','Ponder','1234567','Ponder',0,0,0,0,0,0,0,0,0,'123-12345-1234-123',0,0,0,0,0,0,0,0,0,'Ponder','Ponder',0,0,0,'Test')";
OdbcCommand cmd = new OdbcCommand(sql, myConnection);
myConnection.Open();
cmd.Prepare();
cmd.ExecuteNonQuery();
myConnection.Close();
}
Any help would be much appreciated