Posted: 11.01.2006, 14:37
In unit ZPlainMySqlDriver
IZMySQLPlainDriver = interface (IZPlainDriver)
['{D1CB3F6C-72A1-4125-873F-791202ACC5F0}']
....
function NextResult(Handle: PZMySQLConnect):Integer;
....
end;
{** Implements a driver for MySQL 4.1 }
TZMySQL41PlainDriver = class (TZAbstractObject, IZPlainDriver,
IZMySQLPlainDriver)
public
....
function NextResult(Handle: PZMySQLConnect):Integer;
...
end;
function TZMySQL40PlainDriver.NextResult(Handle: PZMySQLConnect): Integer;
begin
Result:=-1;
end;
function TZMySQL41PlainDriver.NextResult(Handle: PZMySQLConnect): Integer;
begin
Result:=ZPlainMySql41.mysql_next_result(Handle);
end;
in unit ZPlainMySql41;
Tmysql_next_result = function(Handle: PMYSQL): Integer;
{$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
mysql_next_result: Tmysql_next_result;
function TZMySQLNativeLibraryLoader.Load: Boolean;
begin
.....
@mysql_next_result := GetAddress('mysql_next_result')
end;
IZMySQLPlainDriver = interface (IZPlainDriver)
['{D1CB3F6C-72A1-4125-873F-791202ACC5F0}']
....
function NextResult(Handle: PZMySQLConnect):Integer;
....
end;
{** Implements a driver for MySQL 4.1 }
TZMySQL41PlainDriver = class (TZAbstractObject, IZPlainDriver,
IZMySQLPlainDriver)
public
....
function NextResult(Handle: PZMySQLConnect):Integer;
...
end;
function TZMySQL40PlainDriver.NextResult(Handle: PZMySQLConnect): Integer;
begin
Result:=-1;
end;
function TZMySQL41PlainDriver.NextResult(Handle: PZMySQLConnect): Integer;
begin
Result:=ZPlainMySql41.mysql_next_result(Handle);
end;
in unit ZPlainMySql41;
Tmysql_next_result = function(Handle: PMYSQL): Integer;
{$IFNDEF UNIX} stdcall {$ELSE} cdecl {$ENDIF};
mysql_next_result: Tmysql_next_result;
function TZMySQLNativeLibraryLoader.Load: Boolean;
begin
.....
@mysql_next_result := GetAddress('mysql_next_result')
end;