Link to home
Start Free TrialLog in
Avatar of maxc72
maxc72

asked on

Service written in Delphi 2006 that use ADO

I'm writing a windows service using delphi 2006, the service need to make access to an postgre sql Ā database using ado.
I've, in the service, a TADOConnection, when I try to connect the database using
ADOConnection1.Connected := true i receive the error:

"Project Service1.exe raised exception class EOleException with message '[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified'."

The connection string is well placed because if i use the same connection string in a normal vcl application works fine.

The problem is in the service "architecture" i think that I must initialize something, but I don't know what, ie before that error delphi says me that i must call coinitialize to make it work, I've called it using the call:
Olecheck(CoInitialize(nil)); but after I've got the previous error.

Any idea to solve the problem?

SOLUTION
Avatar of BigRat
BigRat
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial