Board index » delphi » dbexpint.dll vs. dbexpint.dcu

dbexpint.dll vs. dbexpint.dcu

Hi,

If I use the dbexpint.dll and GDS32.DLL to access Interbase via dbExpress
everyhing works just fine

  mySQLConnection := TSQLConnection.Create(nil);
  mySQLConnection.DriverName := 'INTERBASE';
  mySQLConnection.GetDriverFunc := 'getSQLDriverINTERBASE';
  mySQLConnection.VendorLib := 'GDS32.DLL';
  mySQLConnection.LibraryName := 'dbexpint.dll';

However if I try to link dbexpint.dcu statically to my application.

uses
  Dbexpint;
....
  mySQLConnection := TSQLConnection.Create(nil);
  mySQLConnection.DriverName := 'INTERBASE';
  mySQLConnection.GetDriverFunc := 'getSQLDriverINTERBASE';
  mySQLConnection.VendorLib := 'GDS32.DLL';
  mySQLConnection.LibraryName := 'dbexpint.dcu';

I get the following error when trying to open the connection:
"Unable to Load GDS32.DLL"

The DLL is on path and dbExpress can find it when I uses dbexpint.dll.

Regards,

Jaakko Salmenius

 

Re:dbexpint.dll vs. dbexpint.dcu


Quote
"Jaakko Salmenius" wrote:
>   mySQLConnection.LibraryName := 'dbexpint.dcu';

Dont set the LibraryName property to the dcu name.

As per the help, include dbexpint in your uses clause. What the help isnt
clear on however, is that you *must* also include midas in the uses clause
also, otherwise you end up with a linker error.

eg:

uses
  dbexpint, midas;

--
Dave Nottage
http://www.fruit.on.net <- Touring the US this summer.

Re:dbexpint.dll vs. dbexpint.dcu


Thank you, that helped.

TSQLConnection.LibraryName must have some value. Otherwise VCL is going to
raise an exception. The problem in my original code was that I has added
several dbExpress drivers in the uses clause

uses
  ddexpint, dbexpmys, ...

It seems that you can link statically only one driver. If you need to uses
more than one drived from the same application you must use external driver
DLLs.

Jaakko

Re:dbexpint.dll vs. dbexpint.dcu


Quote
"Jaakko Salmenius" wrote:
> TSQLConnection.LibraryName must have some value.

Yes, use the same value (ie dbexpint.dll)

Quote
> It seems that you can link statically only one driver.

Yes, again, as per the help.

--
Dave Nottage
http://www.fruit.on.net <- Touring the US this summer.

Other Threads