How to get the value of a special row?
Posted: 01.01.2014, 07:11
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!
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!