Adding Records strange behavour
Posted: Tue 13 Mar 2007 10:18
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?
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?