فهرست منبع

+ Enabled use of embedded firebird library.

git-svn-id: trunk@2333 -
michael 19 سال پیش
والد
کامیت
9cb97e5a99
1فایلهای تغییر یافته به همراه23 افزوده شده و 8 حذف شده
  1. 23 8
      packages/base/ibase/ibase60.inc

+ 23 - 8
packages/base/ibase/ibase60.inc

@@ -8,6 +8,10 @@ interface
 
 {$IFDEF LinkDynamically}
 uses Dynlibs, sysutils;
+
+Var
+  UseEmbeddedFirebird : Boolean = False;
+
 {$ENDIF}
 
 {$IFDEF Unix}
@@ -15,18 +19,21 @@ uses Dynlibs, sysutils;
   const
     gdslib = 'libgds.so';
     fbclib = 'libfbclient.so';
+    fbembedlib = 'libfbembed.so';
 {$ENDIF}
 {$IFDEF Win32}
   {$DEFINE extdecl:=stdcall}
   const
     gdslib = 'gds32.dll';
     fbclib = 'fbclient.dll';
+    fbembedlib = 'fbembed.dll';
 {$ENDIF}
 {$IFDEF Wince}
   {$DEFINE extdecl:=stdcall}
   const
     gdslib = 'gds32.dll';
     fbclib = 'fbclient.dll';
+    fbembedlib = 'fbembed.dll';
 {$ENDIF}
 
 type
@@ -2456,17 +2463,25 @@ begin
   inc(RefCount);
   if RefCount = 1 then
     begin
-    IBaseLibraryHandle := loadlibrary(fbclib);
-    if IBaseLibraryHandle = nilhandle then
+    If UseEmbeddedFirebird then
       begin
-      IBaseLibraryHandle := loadlibrary(gdslib);
-      if loadlibrary(gdslib) = nilhandle then
+      IBaseLibraryHandle:=loadlibrary(fbembedlib);
+      if (IBaseLibraryHandle=nilhandle) then
+        Raise EInOutError.Create('Can not load Firebird Embedded client. Is it installed? ('+fbembedlib+')');
+      end
+    else 
+      begin
+      IBaseLibraryHandle:=loadlibrary(fbclib);
+      if (IBaseLibraryHandle=nilhandle) then
         begin
-        RefCount := 0;
-        Raise EInOutError.Create('Can not load Firebird or Interbase client. Is it installed? ('+gdslib+' or '+fbclib+')');
+        IBaseLibraryHandle:=loadlibrary(gdslib);
+        if (IBaseLibraryHandle=nilhandle) then
+          begin
+          RefCount := 0;
+          Raise EInOutError.Create('Can not load Firebird or Interbase client. Is it installed? ('+gdslib+' or '+fbclib+')');
+          end;
         end;
-      end;
-
+      end;  
     pointer(isc_attach_database) := GetProcedureAddress(IBaseLibraryHandle,'isc_attach_database');
     pointer(isc_array_gen_sdl) := GetProcedureAddress(IBaseLibraryHandle,'isc_array_gen_sdl');
     pointer(isc_array_get_slice) := GetProcedureAddress(IBaseLibraryHandle,'isc_array_get_slice');