I have created a class that has to use SQL-code to do a validation check from my database but when i try to run my program it does not use the ADOquery from my form. I have tried to fix it by adding my main unit to my class's unit but it then gives a circulation error. I have also tried to add Form1 into the uses(that is the name of my form and i only have one form) but then it does not understand Form1. If any one can help, it would be very appreciated.
orait this is in my class:
procedure TCheckA.CheckIfAdmin;
var iRecordA : Integer;
begin
qryInfo.Active := False;
qryInfo.SQL.Clear;
qryInfo.SQL.Add(' Select [Lid Naam], [Lid Wagwoord], Adminustrateur ');
qryInfo.SQL.Add(' From [CATSA Lede] ');
qryInfo.SQL.Add(' Where [Lid Naam] = "'+fgebruikernaam+'"and [Lid Wagwoord] = "'+fpassword+'" and Adminustrateur = True ');
qryInfo.Active := True;
iRecordA := qryinfo.recordcount;
if iRecordA = 1
then begin
fAdminAnswer := True;
end
else begin
fAdminAnswer := False;
end;
end;
Then it throughs this error: [Error] IntekenCheck.pas(29): Undeclared identifier: 'qryInfo'
Then if i try to put my main unit in my class's unit Like:
unit IntekenCheck;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls, Buttons, jpeg, ExtCtrls, XPMan, Grids,
DBGrids, DB, ADODB, Math, AdminCheck, Chairmin_u{main unit};
Then the error is: [Fatal Error] IntekenCheck.pas(7): Circular unit reference to 'IntekenCheck'