mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-22 18:29:33 +02:00
+ removed two win32 configuration calls, which are not a part of ODBC itself
git-svn-id: trunk@1696 -
This commit is contained in:
parent
87846e5986
commit
735281f879
@ -1450,30 +1450,7 @@ var odbcversion:word;
|
|||||||
external odbclib;
|
external odbclib;
|
||||||
{$endif}
|
{$endif}
|
||||||
// This function always load dynamic
|
// This function always load dynamic
|
||||||
type TSQLConfigDataSource=function (
|
|
||||||
hwndParent: Integer;
|
|
||||||
fRequest: Integer;
|
|
||||||
lpszDriverString: String;
|
|
||||||
lpszAttributes: String): SQLRETURN;extdecl;
|
|
||||||
TSQLInstallerError=function (
|
|
||||||
iError: SQLUSMALLINT;
|
|
||||||
pfErrorCode: PSQLINTEGER;
|
|
||||||
lpszErrorMsg: PCHAR;
|
|
||||||
cbErrorMsgMax: SQLUSMALLINT;
|
|
||||||
pcbErrorMsg: PSQLUSMALLINT): SQLRETURN;extdecl;
|
|
||||||
{$ifndef unix}
|
|
||||||
function SQLConfigDataSource(
|
|
||||||
hwndParent: Integer;
|
|
||||||
fRequest: Integer;
|
|
||||||
lpszDriverString: String;
|
|
||||||
lpszAttributes: String): Integer;extdecl;
|
|
||||||
function SQLInstallerError(
|
|
||||||
iError: SQLUSMALLINT;
|
|
||||||
pfErrorCode: PSQLINTEGER;
|
|
||||||
lpszErrorMsg: PCHAR;
|
|
||||||
cbErrorMsgMax: SQLUSMALLINT;
|
|
||||||
pcbErrorMsg: PSQLUSMALLINT): SQLRETURN;
|
|
||||||
{$endif}
|
|
||||||
function DateStructToDateTime( b:PSQL_DATE_STRUCT):TDateTime;
|
function DateStructToDateTime( b:PSQL_DATE_STRUCT):TDateTime;
|
||||||
function DateTimeToDateStruct( b:TDateTime):SQL_DATE_STRUCT;
|
function DateTimeToDateStruct( b:TDateTime):SQL_DATE_STRUCT;
|
||||||
procedure DateTime2TimeStampStruct( var Value:SQL_TIMESTAMP_STRUCT; b:TDateTime);
|
procedure DateTime2TimeStampStruct( var Value:SQL_TIMESTAMP_STRUCT; b:TDateTime);
|
||||||
@ -1620,69 +1597,5 @@ begin
|
|||||||
Result:=EncodeTime(Hour,Minute,Second,0);
|
Result:=EncodeTime(Hour,Minute,Second,0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{function syserrormessage(I : Integer) : string;
|
|
||||||
begin
|
|
||||||
result:='error '+inttostr(i);
|
|
||||||
end;}
|
|
||||||
|
|
||||||
// function SQLConfigDataSource(
|
|
||||||
// hwndParent: Integer;
|
|
||||||
// fRequest: Integer;
|
|
||||||
// lpszDriverString: String;
|
|
||||||
// lpszAttributes: String): Integer;extdecl;external 'ODBCCP32.DLL';
|
|
||||||
|
|
||||||
{$ifndef unix}
|
|
||||||
{function SQLConfigDataSource(
|
|
||||||
hwndParent: Integer;
|
|
||||||
fRequest: Integer;
|
|
||||||
lpszDriverString: String;
|
|
||||||
lpszAttributes: String): Integer;extdecl;
|
|
||||||
var
|
|
||||||
func: TSQLConfigDataSource;
|
|
||||||
begin
|
|
||||||
if OdbccpHMODULE = 0 then
|
|
||||||
begin
|
|
||||||
OdbccpHMODULE := LoadLibrary('ODBCCP32.DLL');
|
|
||||||
if OdbccpHMODULE = 0 then
|
|
||||||
raise Exception.create(syserrormessage(GetLastError));
|
|
||||||
end;
|
|
||||||
|
|
||||||
func := TSQLConfigDataSource(GetProcAddress(OdbccpHMODULE,pchar('SQLConfigDataSource')));
|
|
||||||
if @func = nil then
|
|
||||||
raise Exception.create('Error Getting adress for SQLConfigDataSource'+#13+syserrormessage(GetLastError));
|
|
||||||
|
|
||||||
Result := func(hwndParent,fRequest,lpszDriverString,lpszAttributes);
|
|
||||||
end;
|
|
||||||
|
|
||||||
//SQLRETURN INSTAPI SQLInstallerError(WORD iError,
|
|
||||||
// DWORD *pfErrorCode,
|
|
||||||
// LPSTR lpszErrorMsg,
|
|
||||||
// WORD cbErrorMsgMax,
|
|
||||||
// WORD *pcbErrorMsg);
|
|
||||||
function SQLInstallerError(
|
|
||||||
iError: SQLUSMALLINT;
|
|
||||||
pfErrorCode: PSQLINTEGER;
|
|
||||||
lpszErrorMsg: PCHAR;
|
|
||||||
cbErrorMsgMax: SQLUSMALLINT;
|
|
||||||
pcbErrorMsg: PSQLUSMALLINT): SQLRETURN;
|
|
||||||
var
|
|
||||||
func: TSQLInstallerError;
|
|
||||||
begin
|
|
||||||
if OdbccpHMODULE = 0 then
|
|
||||||
begin
|
|
||||||
OdbccpHMODULE := LoadLibrary('ODBCCP32.DLL');
|
|
||||||
if OdbccpHMODULE = 0 then
|
|
||||||
raise Exception.create(syserrormessage(GetLastError));
|
|
||||||
end;
|
|
||||||
|
|
||||||
func := TSQLInstallerError(GetProcAddress(OdbccpHMODULE,pchar('SQLInstallerError')));
|
|
||||||
|
|
||||||
if @func = nil then
|
|
||||||
raise Exception.create('Error Getting adress for SQLInstallerError'+#13+syserrormessage(GetLastError));
|
|
||||||
|
|
||||||
Result := func( iError, pfErrorCode, lpszErrorMsg, cbErrorMsgMax, pcbErrorMsg);
|
|
||||||
end;}
|
|
||||||
{$endif}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user