网
网络3K
Unregistered / Unconfirmed
GUEST, unregistred user!
说明:DELPHI调用接口成功,VB6调用出错!
以下代码是开发DLL接口给VB调用的,但VB调用不成功,请各位高手帮忙看看看:)
//GetRS(AptPath, aMcaid:AnsiString):Boolean;Stdcall;
//AptPath→TinyDb数据库路径
//aMcaid→传递网卡地址
unit GetData;
interface
uses
Windows, TinyDB;
function GetRS(AptPath, aMcaid:AnsiString):Boolean;Stdcall;
implementation
function GetRS(AptPath, aMcaid:AnsiString):Boolean;Stdcall;
var
TTB:TTinyTable;
begin
try
TTB:=TTinyTable.Create(nil);
try
TTB.DatabaseName := AptPath;
TTB.TableName := 'Userinfo';
TTB.Password := 'hi0898_server_V0.1';
TTB.Open;
if TTB.FieldValues['Macid']=aMcaid then// 判断数据库中是否存在传递参数的网卡地址, 存在就返回值。
Result :=True
else Result := False;
finally
TTB.Close;
TTB.Free;
end;
except
Result := False;
end;
end;
以下代码是开发DLL接口给VB调用的,但VB调用不成功,请各位高手帮忙看看看:)
//GetRS(AptPath, aMcaid:AnsiString):Boolean;Stdcall;
//AptPath→TinyDb数据库路径
//aMcaid→传递网卡地址
unit GetData;
interface
uses
Windows, TinyDB;
function GetRS(AptPath, aMcaid:AnsiString):Boolean;Stdcall;
implementation
function GetRS(AptPath, aMcaid:AnsiString):Boolean;Stdcall;
var
TTB:TTinyTable;
begin
try
TTB:=TTinyTable.Create(nil);
try
TTB.DatabaseName := AptPath;
TTB.TableName := 'Userinfo';
TTB.Password := 'hi0898_server_V0.1';
TTB.Open;
if TTB.FieldValues['Macid']=aMcaid then// 判断数据库中是否存在传递参数的网卡地址, 存在就返回值。
Result :=True
else Result := False;
finally
TTB.Close;
TTB.Free;
end;
except
Result := False;
end;
end;