Unable to access SQL table from appl running as service

76 Views Asked by At

I have a small test application, made with Delphi 10.3.1 as an Stand Alone HTTPSYS Intraweb service. It has an ADOConnection and a ADOTable and in FormShow of unit1, I open the connection, and the table and reads the first 10 rows and add them to a listbox. Just to see that it works and is possible.

When running the application as a Stand Alone HTTPSYS, vith visual GUI, it's working nicely, but when I compile it as a service, and install it, on the sql server, or on the development machine, it fails with access Violation, trying to open the table. I suppose it is an Authentication problem.

I have tried to open connection with both Windows Auth, and with a specific SQL login, and I have tried running the service with both local system (default) and with the specific SQL account.

What am I missing ?

The Specific SQL login, works in SSMS. I'm able to use it to login and access my tables.

Also, if I create the application as a DLL and put it on my IIS10, it works fine.

1

There are 1 best solutions below

0
On

You are right. It has nothing to do with authentication.

For the IntraWeb HttpSys Stand Alone program to run as a service, the ServerController.ComInitialization property must be set to ciMultiThreaded.

Thanks for your comment which lead me to look elsewhere. You do deserve the credit.

Regards Soren