i.eg.
if SGDB = 'FIREBIRD' then
begin
{$define FIREBIRD};
end;
if SGDB = 'MSSQL' then
begin
{$define MSSQL};
end;
Thanks.
No, You need to find out what DB is being used and flow your
code around it at run time or, stop using what ever it is that
most likely only works on one and not the other.
yeah, i know. i've already define some functions to make my SQL
Statements properly to a specific SGDB, like:
function SQLTopClause: String;
begin
{$ifdef FIREBIRD}
Result := 'First';
{$else if MSSQL}
Result := 'Top';
{$endif}
end;
just like that, ok?
but, i need to define the condition at runtime using a PARAMETER
defined at initialization process of the first unit of my project,
just as i've said on the fist message of this topic.
what should i do? use If Conditional Statements instead?
unit dbSupporter;
interface
Type tdbType = (dbMSSQL, dbFireBird);
var dbType : tdbType = dbMSSQL;
Initialization
If CompareText (ParamStr (1), 'FIREBIRD') = 0
then dbType := dbFireBird;
end.
// some unit
Uses . . ., dbSupporter, . . .;
Const cTopClauses : array [tdbType] of string = ('Top', 'First');
function sqlTopClause : string;
begin
result := cTopClauses [dbType];
end;