Service written in Delphi 2006 that use ADO
Posted on 2008-10-10
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?