Hello,
I am a new guy with Zeos and I am using C++ builder 6.0+zeoslib 6.6+MySQL 5.0. What I want to do is get the value of the returned rows and then copy the value to a array, my code is list below:
FMain->ZQuery1->SQL->Clear();
FMain->ZQuery1->SQL->Add("select slot from boardinfo where neid=:id");
FMain->ZQuery1->ParamByName("id")->AsInteger=1;
FMain->ZQuery1->Open();
int j=FMain->ZQuery1->RecordCount;
FMain->ZQuery1->DbcResultSet->First();
for(int i=0;i<j;i++)
{
PNode->BoardInfo.v=FMain->ZQuery1->DbcResultSet->GetIntByName("slot");
FMain->ZQuery1->DbcResultSet->Next();
}
There is only one column "slot" returned and the RecordCount is 32, that is correct and I can get the values one by one.
But,if I want to get the value of a special row, for example, get the value of the fifth row in the returned column "slot", how could I do?
Thank you in advance and Happy New Year!
How to get the value of a special row?
Moderators: gto, EgonHugeist
-
- Fresh Boarder
- Posts: 5
- Joined: 01.01.2014, 06:41
How to get the value of a special row?
Last edited by detective0922 on 04.01.2014, 19:09, edited 1 time in total.
-
- Fresh Boarder
- Posts: 5
- Joined: 01.01.2014, 06:41
Re: How to get the value of a special row?
I update the question, could anyone help me?
Re: How to get the value of a special row?
@detective0922
Maybe so?:
Michal
Maybe so?:
Code: Select all
ZQuery1->First();
ZQuery1->MoveBy(4);
Edit1->Text = ZQuery1->FieldByName("slot")->AsString;
-
- Fresh Boarder
- Posts: 5
- Joined: 01.01.2014, 06:41
Re: How to get the value of a special row?
Hi, miab3, thank you very much, it is a useful solution.miab3 wrote:@detective0922
Maybe so?:MichalCode: Select all
ZQuery1->First(); ZQuery1->MoveBy(4); Edit1->Text = ZQuery1->FieldByName("slot")->AsString;