Search path for sqloledb.dll problems, wrong path

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
JanA
Posts: 4
Joined: Wed 09 Oct 2013 18:24

Search path for sqloledb.dll problems, wrong path

Post by JanA » Thu 10 Oct 2013 11:48

Hi,

I have succesfully made a console application, connecting to a MSSQL 2012 Express, console application is named cgi.exe.

Wehn I use this cgi.exe as a cgi on an Apache server on Windows 7 64, the unmodified cgi.exe dosnt work - it returns:

"OLE DB error occured. Code 8000700Eh"

Tracking whats going on with "Process Monitor", the driver uses a different search path for sqloledb.dll when used as a cgi under Apache - file path looks like this in Process Monitor:

C:\Users\PC\ApacheServer\cgi-bin\%CommonProgramFiles(86)%\System\Ole DB\sqloledb.dll

.. and about 50 variants of the above, all extending the path with %CommonProgramFiles(86)%.

Trying to set a filepath to sqloledb.dll is ignored by the driver.

My init code looks like this in C++ Builder:
SQLConnection1->DriverName="DevartSQLServer";
SQLConnection1->GetDriverFunc = "getSQLDriverSQLServer";
SQLConnection1->VendorLib = "C:\\driver\\sqloledb.dll"; // attempt to set a path
// SQLConnection1->VendorLib = "sqloledb.dll"; // original
SQLConnection1->LibraryName = "dbexpsda40.dll";

Have now used all day, 12 hours, in the attempt to make this work - any help is very much appreciated.

AndreyZ

Re: Search path for sqloledb.dll problems, wrong path

Post by AndreyZ » Thu 10 Oct 2013 14:49

Hello,

dbExpress driver for SQL Server does not load the sqloledb.dll library directly. dbExpress driver for SQL Server creates a COM object with CLSID = CLSID_SQLOLEDB = {0C7FF16C-38E3-11d0-97AB-00C04FC2AD98} . You can take a look at the path to the sqloledb.dll library which this COM object uses in the registry editor. Go to the HKEY_CLASSES_ROOT\CLSID\{0C7FF16C-38E3-11d0-97AB-00C04FC2AD98}\InprocServer32 key and take a look at the (Default) value. It stores the path to the sqloledb.dll library, it must be "%CommonProgramFiles%\System\Ole DB\sqloledb.dll" . If you see "C:\Users\PC\ApacheServer\cgi-bin\%CommonProgramFiles(86)%\System\Ole DB\sqloledb.dll" in Process Monitor, it means that your Apache server adds the "C:\Users\PC\ApacheServer\cgi-bin\" string. For more information how to avoid such problem, please contact the Apache support.

JanA
Posts: 4
Joined: Wed 09 Oct 2013 18:24

Re: Search path for sqloledb.dll problems, wrong path

Post by JanA » Thu 10 Oct 2013 15:01

Thanks for the reply - so a solution is to use the "Universal Data Access Components", and not the dbexpress components - or ...... ?

How does the "Universal Data Access Components" get the sqloledb.ddl ?

Apache is one of the most used web servers out there - you make it sound like this is a off-stream server .....

JanA
Posts: 4
Joined: Wed 09 Oct 2013 18:24

Re: Search path for sqloledb.dll problems, wrong path

Post by JanA » Thu 10 Oct 2013 15:03

Will it work under IIS ?

JanA
Posts: 4
Joined: Wed 09 Oct 2013 18:24

Re: Search path for sqloledb.dll problems, wrong path

Post by JanA » Thu 10 Oct 2013 20:14

Have you tested and confirmed, that your components for MSSQL works under IIS and ISAPI under IIS ?

AndreyZ

Re: Search path for sqloledb.dll problems, wrong path

Post by AndreyZ » Fri 11 Oct 2013 07:12

All our products that work with SQL Server, use the COM interface to work with SQL Server providers, OLE DB or Native Client. It means that we do not load libraries directly, it is done by the COM object (in the way I described you in my previous post). For more information about this, you can write to the Microsoft support.
If your application behaves differently when used on an Apache server, such question can be resolved by configuring the Apache server. This is out of scope of our support, you can write to the Apache support.
We have had several requests from our users who use our products (SDAC, UniDAC) in IIS as ISAPI extensions. So, we can confirm that our components work in IIS.

Post Reply