If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > C++ Table Database Problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-14-04, 16:09
someThinker someThinker is offline
Registered User
 
Join Date: Oct 2004
Posts: 3
C++ Table Database Problem

I would be grateful if you could help me with my problem. My problem is once I open database file into table,and I would like to read from first row values and then use them in other columns for results, but my program read first row and then doesn’t append first row, but instead puts values into second row.

Here is the code that I using at the moment

if (Table1->Active) {

Table1->First();

float x,sn,y;

while (!(Table1->Eof)){

sn = Table1->Fields->FieldByName("Sample n")->AsFloat;
x = Table1->FieldByName("Input X n")->AsFloat;
y=x+sn;

Table1->Append();
Table1->FieldByName("Input C X n")->AsFloat=y;
//would like this value to appear in 1st row
Table1->Post();
//but creates new second row and place it in there

Table1->Next(); //then count onto second row

}

Please help

Thanx
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On