GetTableNames fails on DBExpress 6.2

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
MrAndini
Posts: 19
Joined: Mon 07 Oct 2013 11:18

GetTableNames fails on DBExpress 6.2

Post by MrAndini » Mon 07 Oct 2013 11:32

I have just moved a project from XE2 to XE4 and installed the latest DBExpress driver. The code which was working under XE2 returns no tables when I execute the TSQLConnection->GetTableNames

When I initially installed under XE4 I got the following error
[ILINK32 Error] Fatal: Unable to open file 'DBXDEVARTSQLSERVERREADONLYMETADATA.OBJ'

Checked all the paths and they seemed fine, did a build again and worked but failed at the GetTableNames, returns no tables but create of table says table exists.

Went back to my previously working XE2 code which just had the latest DBExpress driver installed and it won't run at all. Fails continuously at
[ILINK32 Error] Fatal: Unable to open file 'DBXDEVARTSQLSERVERREADONLYMETADATA.OBJ'

Include Paths are correct/same apart from version for both XE2 and XE4
using the following to establish connection.

// Devart connection
SQLConnection->DriverName = "DevartSQLServer";
SQLConnection->GetDriverFunc = "getSQLDriverSQLServer";
SQLConnection->LibraryName = "dbexpsda40.dll";
SQLConnection->VendorLib = "sqloledb";

MrAndini
Posts: 19
Joined: Mon 07 Oct 2013 11:18

Re: GetTableNames fails on DBExpress 6.2

Post by MrAndini » Mon 07 Oct 2013 11:35

Further update.
Got XE2 working by compiling a release build then going back to the debug build.
GetTableNames returns an empty string list for both XE2 and XE4.

Worked with previous version of DBExpress driver

AndreyZ

Re: GetTableNames fails on DBExpress 6.2

Post by AndreyZ » Mon 07 Oct 2013 13:01

To solve the problem, you should set the SchemaOverride connection parameter to '%.dbo' . Here is a code example:

Code: Select all

SQLConnection1->Params->Values["SchemaOverride"] = "%.dbo";

MrAndini
Posts: 19
Joined: Mon 07 Oct 2013 11:18

Re: GetTableNames fails on DBExpress 6.2

Post by MrAndini » Mon 07 Oct 2013 13:48

Thanks that did it :D (Slightly different as I add the params but same deal)

SQLConnection->Params->Add("SchemaOverride=%.dbo");

AndreyZ

Re: GetTableNames fails on DBExpress 6.2

Post by AndreyZ » Tue 08 Oct 2013 07:45

I am glad I could help. If any other questions come up, please contact us.

MrAndini
Posts: 19
Joined: Mon 07 Oct 2013 11:18

Re: GetTableNames fails on DBExpress 6.2

Post by MrAndini » Tue 08 Oct 2013 09:04

I am trying to install my application on my notebook as well as desktop so if I need to make changes in the field I can.

However it is giving me the same link error I initially got on the windows 7 machine but I cannot get it to go away
linker cannot find DBXDEVARTSQLSERVERREADONLYMETADATA.OBJ

On the windows 7 64 bit machine I am not really sure how I got it to go away, seemed to dissapear after I did a release build and run. On my windows 8 32 bit notebook I just cannot eliminate this error?

C++ Builder XE2 on both machines.

AndreyZ

Re: GetTableNames fails on DBExpress 6.2

Post by AndreyZ » Tue 08 Oct 2013 11:11

I cannot reproduce the problem. Please try creating a new project and check if the problem occurs with it.

MrAndini
Posts: 19
Joined: Mon 07 Oct 2013 11:18

Re: GetTableNames fails on DBExpress 6.2

Post by MrAndini » Mon 14 Oct 2013 14:20

I have got around this by uninstalling XE2 and just using the XE4 version, now works fine. However when I release to user they get a read of 0000 when trying to open a table but this works fine on my deveopment machine.

I wonder if anything has changed between versions of DBExpress such that I now need to initialise something which I previously didn't need to. Is there a change log I can look at for latest DBExpress driver, or suggestion how to track down the error?

AndreyZ

Re: GetTableNames fails on DBExpress 6.2

Post by AndreyZ » Tue 15 Oct 2013 08:55

You can find the revision history of dbExpress driver for SQL Server at http://www.devart.com/dbx/sqlserver/rev ... story.html . If you reproduce the problem in a small project, please send it to me, I will investigate it and give you a valid answer.

MrAndini
Posts: 19
Joined: Mon 07 Oct 2013 11:18

Re: GetTableNames fails on DBExpress 6.2

Post by MrAndini » Tue 15 Oct 2013 13:32

Thanks for the prompt reply.
I downloaded trial version of Eurekalog and ran it on the code.
Exception occurs in the DBClient module from Embarcadero, searching shows this may be due to a Midas.dll version issue. Installed units may be using the XE2 version of midas.dll instead of the XE4 version. Hence works on both my machines but not theirs.

AndreyZ

Re: GetTableNames fails on DBExpress 6.2

Post by AndreyZ » Tue 15 Oct 2013 14:03

It is possible that the problem is caused by the usage of the incorrect Midas library version.

MrAndini
Posts: 19
Joined: Mon 07 Oct 2013 11:18

Re: GetTableNames fails on DBExpress 6.2

Post by MrAndini » Tue 15 Oct 2013 14:09

Do I also need to be wary of the dbexpsda40.dll version?

MrAndini
Posts: 19
Joined: Mon 07 Oct 2013 11:18

Re: GetTableNames fails on DBExpress 6.2

Post by MrAndini » Wed 16 Oct 2013 01:51

Now working fine with Midaslib included into my source code so no DLL required with distribution.

I have asked a separate question on this forum, is it possible to include the DBexpress drivers into my code so I don't need to distribute the separate DLL.

Using C++ Builder XE4.

AndreyZ

Re: GetTableNames fails on DBExpress 6.2

Post by AndreyZ » Wed 16 Oct 2013 05:45

Each new version of the dbexpsda40.dll library contains some bug fixes and possibly new functionality. Therefore, it is better to make sure that the latest dbexpsda40.dll library is deployed with your applications.
It is possible to include the dbExpress driver into an application, but only when using the Source Code edition.

MrAndini
Posts: 19
Joined: Mon 07 Oct 2013 11:18

Re: GetTableNames fails on DBExpress 6.2

Post by MrAndini » Wed 16 Oct 2013 07:25

Thanks for that, if I upgrade to source edition is there a link that details how to do this or does it automatically become part of project when you use source version?

Post Reply