Problem with SELECT statment, Please help!
Posted: Fri 08 Dec 2006 13:52
Hi,
I am using MyDAC version 4.40.0.20 for Delphi 7.
MySQL version 4.1.14
I have a problem with the following code:
executed is set to true once the MyQuery1.AfterExecute procedure is called.
The problem I have is that MyQuery1.Params.count = 0, but it should be at least 1 (ie, returning a row with the count) ???
Can you please let me know what I am doing wrong?
Thanks,
Gerald.
I am using MyDAC version 4.40.0.20 for Delphi 7.
MySQL version 4.1.14
I have a problem with the following code:
Code: Select all
Var Numlinks : Longint;
Begin
MyConnection1.Connect;
MyQuery1.SQL.Clear;
MyQuery1.SQL.Add('SELECT COUNT(*) FROM `PLD_LINK`;');
MyQuery1.Execute;
repeat
application.ProcessMessages;
Until (executed) or (Cancel);
If (Executeok) Then
Begin
Statusbar.Panels[0].Text := inttostr(MyQuery1.Params.count);
NumLinks := strtoint(MyQuery1.Params[0].Asstring);
End;
MyConnection1.Disconnect;
End;The problem I have is that MyQuery1.Params.count = 0, but it should be at least 1 (ie, returning a row with the count) ???
Can you please let me know what I am doing wrong?
Thanks,
Gerald.