function TDataAccessModule.Login(const userName : String;
const Password : String) : Boolean;
begin
try
with ADOQuery do
begin
Close;
Sql.Clear;
Sql.Add('SELECT Password FROM admin WHERE UserID = ' + Quotedstr(userName));
Prepared;
Open;
end;
except
raise Exception.Create('Query Database Error!');
Application.MessageBox('Query Database Error!', 'SIMS', MB_OK + MB_ICONERROR);
Login := False;
Exit;
end; if (Password = ADOQuery.FieldByName('Password').Value) then
Login := True
else
Login := False;
end;错误如下:
---------------------------
Debugger Exception Notification
---------------------------
Project SIMS.exe raised exception class EAccessViolation with message 'Access violation at address 0046AFC9 in module 'SIMS.exe'. Read of address 0000005C'.
---------------------------
Break Continue Help
---------------------------
const Password : String) : Boolean;
begin
try
with ADOQuery do
begin
Close;
Sql.Clear;
Sql.Add('SELECT Password FROM admin WHERE UserID = ' + Quotedstr(userName));
Prepared;
Open;
end;
except
raise Exception.Create('Query Database Error!');
Application.MessageBox('Query Database Error!', 'SIMS', MB_OK + MB_ICONERROR);
Login := False;
Exit;
end; if (Password = ADOQuery.FieldByName('Password').Value) then
Login := True
else
Login := False;
end;错误如下:
---------------------------
Debugger Exception Notification
---------------------------
Project SIMS.exe raised exception class EAccessViolation with message 'Access violation at address 0046AFC9 in module 'SIMS.exe'. Read of address 0000005C'.
---------------------------
Break Continue Help
---------------------------
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货