Runtime error on connection (MySQL)

Help
2011-08-07
2013-05-01
  • Leonardo Sasso
    Leonardo Sasso
    2011-08-07

    Hello,

    I've installed open dbexpress and is connecting perfectly in design time to MySQL, I can open tables, make queries etc.
    However when I try to connect in runtime I get an exception EClassRegistryError: "TDBXDynaLinkDriverLoaderOpenOdbc class registered with a nil class reference" Any idea why? it's very frustrating that it works so well in design time but not in runtime.
    I use Borland 2011 (C++), MySQL 5.01. I compiled the opendbx project and generated the bpl. Does it take a bpi too?
    Thanks

    Leo

     
  • Look at the examples and correct your section "uses" for the project.

    Example:

    program Project1;
    uses
      {$IFDEF _MEMCHECK_}
      FastMM4,
      {$ENDIF}
      Windows,
      DbxOpenOdbcStatic, { optional }
      DbxXXDrv, { critical }
      //MidasLib, { Link ClientDatSet statically }
      Forms,

     
  • The next version of Delphi will include native dbx odbc driver from the embarcadero.

     
  • Leonardo Sasso
    Leonardo Sasso
    2011-08-07

    Thank you pult, you hit right in the nail. I added the line:

       #pragma link "DbxXXDrv.obj"

    which is the C++  equivalent to delphi's USES
    then I had to copy all the obj files from the free project into the path, now it works in runtime.
    Thank you!