Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.

Welcome, Guest
Guest Settings

Thread: DBexpress connection fails if code executing into a service

Permlink Replies: 0
Eugenio Monti

Posts: 3
Registered: 3/16/00
DBexpress connection fails if code executing into a service
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 17, 2014 9:15 AM
I'm developing with C++Builder XE6 and MSSQL.
I already developed DB application that work fine...but
for the first time I write code as service.
My test code is the following:

DBconn = new TSQLConnection(Yoko_PRES);
DBconn->DriverName = "MSSQL";
DBconn->ConnectionName = "MSSQLConnection";
DBconn->LoginPrompt = false;
try {
DBconn->Connected = true;
catch (TDBXError *ERR) {
AS = ERR->Message;
sprintf(s, "Errore connessione database\n%s", AS.c_str());

Yoko_PRES is my service object.
If I run that code in a form application works fine.
If I run that form application from C:\Windows\System32, it works fine.
If I install my service ed start it from service manager it starts but give me the error:
"DBX Error: Driver could not be properly initialized. Client library may be missing, not installed properly, of thoute wrong version, or the driver may be missing from the system path."

My application works without dinamic RTL and dinamic packages so the only files it needs are
I tried to copy them in C:\Windows\System32 folder without success.
Can I have to do?
Please give me some suggestions.
Thanks in advance. Bye.
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02