I am trying to add 3 records to a virtual table.
If the table is empty, 4 records are created, the first record contains only the value of the first field, the other 3 records are correct.
If the table contains data, the first record gets the first field updated, and 3 new records gets created correctly.
The source of what i do is:
-------------------------------------------------------------------------------------
String Server;
Server = frmSetup->fldServerName->Text;
frmMain->tblSettings->FindLast();
frmMain->tblSettings->Append();
frmMain->tblSettings->FieldByName("fldServer")->SetData(Server.c_str(),true);
frmMain->tblSettings->FieldByName("fldApplication")->SetData("Server",true);
frmMain->tblSettings->FieldByName("fldParameter")->SetData("Address",true);
frmMain->tblSettings->FieldByName("fldValue")->SetData(frmSetup->fldServerIP->Text.c_str(),true);
frmMain->tblSettings->Post();
frmMain->tblSettings->Append();
frmMain->tblSettings->FieldByName("fldServer")->SetData(Server.c_str(),true);
frmMain->tblSettings->FieldByName("fldApplication")->SetData("Server",true);
frmMain->tblSettings->FieldByName("fldParameter")->SetData("SID",true);
frmMain->tblSettings->FieldByName("fldValue")->SetData(frmSetup->fldServerSID->Text.c_str(),true);
frmMain->tblSettings->Post();
frmMain->tblSettings->Append();
frmMain->tblSettings->FieldByName("fldServer")->SetData(Server.c_str(),true);
frmMain->tblSettings->FieldByName("fldApplication")->SetData("Server",true);
frmMain->tblSettings->FieldByName("fldParameter")->SetData("Password",true);
frmMain->Aanpassen = frmSetup->fldServerPassword->Text;
pencode(Sender);
frmMain->tblSettings->FieldByName("fldValue")->SetData(frmMain->Aanpassen.c_str(),true);
frmMain->tblSettings->Post();
-------------------------------------------------------------------------------------
Note that nowhere in the application is any code working with this table.
Any one got a clue on this exta record update?
Adding Records strange behavour
Solved
The problem has been resolved.
The issue was with the first field which was a TDBLookupListBox.
Appearently this listbox updated 1 record before the program was run to add tree records.
After changing this to a normal TListBox, and filling that with the database values, the problem was solved.
Sorry for net reporting this sooner (it took me almost 2 days to figure this out).
This was with Borland Developer Studio Pro 2006 and ODAC 5.70
Thanks foy your support.
The issue was with the first field which was a TDBLookupListBox.
Appearently this listbox updated 1 record before the program was run to add tree records.
After changing this to a normal TListBox, and filling that with the database values, the problem was solved.
Sorry for net reporting this sooner (it took me almost 2 days to figure this out).
This was with Borland Developer Studio Pro 2006 and ODAC 5.70
Thanks foy your support.