|
@@ -7,16 +7,21 @@ interface
|
|
uses
|
|
uses
|
|
Classes, SysUtils, toolsunit
|
|
Classes, SysUtils, toolsunit
|
|
,db, sqldb
|
|
,db, sqldb
|
|
- ,mysql40conn, mysql41conn, mysql50conn, mysql51conn, mysql55conn
|
|
|
|
- ,ibconnection
|
|
|
|
|
|
+ ,mysql40conn, mysql41conn, mysql50conn, mysql51conn, mysql55conn,ibconnection
|
|
|
|
+ {$IFNDEF WIN64}
|
|
|
|
+ {See packages\fcl-db\src\sqldb\postgres\fpmake.pp: postgres connector won't be present on Win64}
|
|
,pqconnection
|
|
,pqconnection
|
|
|
|
+ {$ENDIF WIN64}
|
|
,odbcconn
|
|
,odbcconn
|
|
{$IFNDEF WIN64}
|
|
{$IFNDEF WIN64}
|
|
{See packages\fcl-db\fpmake.pp: Oracle connector is not built if PostgreSQL connectoris not built}
|
|
{See packages\fcl-db\fpmake.pp: Oracle connector is not built if PostgreSQL connectoris not built}
|
|
,oracleconnection
|
|
,oracleconnection
|
|
{$ENDIF WIN64}
|
|
{$ENDIF WIN64}
|
|
,sqlite3conn
|
|
,sqlite3conn
|
|
|
|
+ {$IFNDEF WIN64}
|
|
|
|
+ {This won't be available on Windows 64, either; perhaps other systems as well}
|
|
,mssqlconn
|
|
,mssqlconn
|
|
|
|
+ {$ENDIF WIN64}
|
|
;
|
|
;
|
|
|
|
|
|
type TSQLDBTypes = (mysql40,mysql41,mysql50,mysql51,mysql55,postgresql,interbase,odbc,oracle,sqlite3,mssql,sybase);
|
|
type TSQLDBTypes = (mysql40,mysql41,mysql50,mysql51,mysql55,postgresql,interbase,odbc,oracle,sqlite3,mssql,sybase);
|
|
@@ -150,7 +155,7 @@ begin
|
|
FieldtypeDefinitions[ftVarBytes] := 'VARBINARY(10)';
|
|
FieldtypeDefinitions[ftVarBytes] := 'VARBINARY(10)';
|
|
FieldtypeDefinitions[ftMemo] := 'CLOB'; //or TEXT SQLite supports both, but CLOB is sql standard (TEXT not)
|
|
FieldtypeDefinitions[ftMemo] := 'CLOB'; //or TEXT SQLite supports both, but CLOB is sql standard (TEXT not)
|
|
end;
|
|
end;
|
|
- {$IFNDEF win64}
|
|
|
|
|
|
+ {$IFNDEF Win64}
|
|
if SQLDbType = POSTGRESQL then
|
|
if SQLDbType = POSTGRESQL then
|
|
begin
|
|
begin
|
|
Fconnection := tPQConnection.Create(nil);
|
|
Fconnection := tPQConnection.Create(nil);
|
|
@@ -159,7 +164,7 @@ begin
|
|
FieldtypeDefinitions[ftMemo] := 'TEXT';
|
|
FieldtypeDefinitions[ftMemo] := 'TEXT';
|
|
FieldtypeDefinitions[ftGraphic] := '';
|
|
FieldtypeDefinitions[ftGraphic] := '';
|
|
end;
|
|
end;
|
|
- {$ENDIF win64}
|
|
|
|
|
|
+ {$ENDIF Win64}
|
|
if SQLDbType = INTERBASE then
|
|
if SQLDbType = INTERBASE then
|
|
begin
|
|
begin
|
|
Fconnection := tIBConnection.Create(nil);
|
|
Fconnection := tIBConnection.Create(nil);
|
|
@@ -170,6 +175,7 @@ begin
|
|
{$IFNDEF Win64}
|
|
{$IFNDEF Win64}
|
|
if SQLDbType = ORACLE then Fconnection := TOracleConnection.Create(nil);
|
|
if SQLDbType = ORACLE then Fconnection := TOracleConnection.Create(nil);
|
|
{$ENDIF Win64}
|
|
{$ENDIF Win64}
|
|
|
|
+ {$IFNDEF Win64}
|
|
if SQLDbType in [MSSQL,Sybase] then
|
|
if SQLDbType in [MSSQL,Sybase] then
|
|
// todo: Sybase: copied over MSSQL; verify correctness
|
|
// todo: Sybase: copied over MSSQL; verify correctness
|
|
begin
|
|
begin
|
|
@@ -185,6 +191,7 @@ begin
|
|
FieldtypeDefinitions[ftMemo] := 'TEXT';
|
|
FieldtypeDefinitions[ftMemo] := 'TEXT';
|
|
FieldtypeDefinitions[ftGraphic] := '';
|
|
FieldtypeDefinitions[ftGraphic] := '';
|
|
end;
|
|
end;
|
|
|
|
+ {$ENDIF Win64}
|
|
|
|
|
|
if SQLDbType in [mysql40,mysql41,mysql50,mysql51,mysql55,odbc] then
|
|
if SQLDbType in [mysql40,mysql41,mysql50,mysql51,mysql55,odbc] then
|
|
begin
|
|
begin
|
|
@@ -225,7 +232,7 @@ begin
|
|
testValues[ftFixedChar,t] := PadRight(testValues[ftFixedChar,t], 10);
|
|
testValues[ftFixedChar,t] := PadRight(testValues[ftFixedChar,t], 10);
|
|
|
|
|
|
|
|
|
|
- if not assigned(Fconnection) then writeln('Invalid database-type, check if a valid database-type was provided in the file ''database.ini''');
|
|
|
|
|
|
+ if not assigned(Fconnection) then writeln('Invalid database type, check if a valid database type for your achitecture was provided in the file ''database.ini''');
|
|
|
|
|
|
with Fconnection do
|
|
with Fconnection do
|
|
begin
|
|
begin
|