不行啊!
Access Violation at address 77991485 in module 'oldaut32.dll'.read of address 0013c000
//----------------------代码如下--------------------------------
library Account;
uses
SysUtils,
Classes,
ADOdb;
type
{$R *.RES}
function GetAccountInfo(ADOCnn: TADOConnection; uAccount, uPassword: WideString; out uStaffId: integer; uName: WideString): integer; stdcall;
var
AdoQry: TAdoQuery;
begin
Result := 1;
if (not length(uAccount) > 0) and (not length(uPassword) > 0) then
begin
Result := 1;
exit;
end;
if ADOCnn.Connected then
begin
AdoQry := TAdoQuery.Create(nil);
with AdoQry do
begin
Connection := AdoCnn;
Close;
SQL.Clear;
SQL.Add('select * from Vacc0204_ActiveAcountInfo where Account=' + '''' + uAccount + '''' + ' and uPassword=' + '''' + uPassword + '''');
try
Open;
if RecordCount > 0 then
begin
First;
uStaffId := FieldByName('StaffID').asinteger;
uName := FieldByName('Pname').asstring;
Result := 0;
end
else begin
Result := 1;
end;
except
Result := 1;
end;
Close;
Free;
end;
end
else Result := 1;
end;