Search code examples
sql-serverdelphiconnectionsql-server-expressdbexpress

Connecting to SQL Server using Delphi and dbExpress


I use RAD Studio 2010 including latest updates 4 and 5, my database is SQL Server Express.

I set up a TSQLConnection but it won't connect, error message is "DBX-Error: the driver could not be initialized correctly. A client library may be missing, may not be installed correctly, or may have the wrong version" (error messagetranslated from German).

Connecting to the database via TADOConnection works fine with both ADO drivers ("Microsoft OLE DB Provider for SQL Server" and "SQL Native Client").

Can anybody give me a hint how to connect via dbExpress?


Solution

  • you need to install the sql native client, if you read the read me that comes with RAD studio 2010 its says that it is a requirement for connecting to sql server 2000/2005/2008

    I’ve also discovered that in dbxdrivers.ini they haven’t added the proper option for MSSQL 2000/2005 you need to edit the top bit to add in MSSQL9=1

    example:

    [Installed Drivers]
    DBXTrace=1
    DBXPool=1
    BlackfishSQL=1
    DataSnap=1
    ASA=1
    ASE=1
    DB2=1
    Firebird=1
    Informix=1
    Interbase=1
    MSSQL=1
    MSSQL9=1
    MySQL=1
    Oracle=1
    

    you can then select MSSQL9 as a dbExpress option and it should also appear in data explorer as well