Page 1 of 2

GetTableNames fails on DBExpress 6.2

Posted: Mon 07 Oct 2013 11:32
by MrAndini
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";

Re: GetTableNames fails on DBExpress 6.2

Posted: Mon 07 Oct 2013 11:35
by MrAndini
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

Re: GetTableNames fails on DBExpress 6.2

Posted: Mon 07 Oct 2013 13:01
by AndreyZ
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";

Re: GetTableNames fails on DBExpress 6.2

Posted: Mon 07 Oct 2013 13:48
by MrAndini
Thanks that did it :D (Slightly different as I add the params but same deal)

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

Re: GetTableNames fails on DBExpress 6.2

Posted: Tue 08 Oct 2013 07:45
by AndreyZ
I am glad I could help. If any other questions come up, please contact us.

Re: GetTableNames fails on DBExpress 6.2

Posted: Tue 08 Oct 2013 09:04
by MrAndini
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.

Re: GetTableNames fails on DBExpress 6.2

Posted: Tue 08 Oct 2013 11:11
by AndreyZ
I cannot reproduce the problem. Please try creating a new project and check if the problem occurs with it.

Re: GetTableNames fails on DBExpress 6.2

Posted: Mon 14 Oct 2013 14:20
by MrAndini
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?

Re: GetTableNames fails on DBExpress 6.2

Posted: Tue 15 Oct 2013 08:55
by AndreyZ
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.

Re: GetTableNames fails on DBExpress 6.2

Posted: Tue 15 Oct 2013 13:32
by MrAndini
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.

Re: GetTableNames fails on DBExpress 6.2

Posted: Tue 15 Oct 2013 14:03
by AndreyZ
It is possible that the problem is caused by the usage of the incorrect Midas library version.

Re: GetTableNames fails on DBExpress 6.2

Posted: Tue 15 Oct 2013 14:09
by MrAndini
Do I also need to be wary of the dbexpsda40.dll version?

Re: GetTableNames fails on DBExpress 6.2

Posted: Wed 16 Oct 2013 01:51
by MrAndini
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.

Re: GetTableNames fails on DBExpress 6.2

Posted: Wed 16 Oct 2013 05:45
by AndreyZ
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.

Re: GetTableNames fails on DBExpress 6.2

Posted: Wed 16 Oct 2013 07:25
by MrAndini
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?