cancel
Showing results for 
Search instead for 
Did you mean: 

Windows Service not connecting to SQL Anywhere DB

Former Member
7,582

Hi,

I had built an application to connect to SyBase - SQL Anywhere DB using VB.NET and appropriate ODBC connection. This was working fine until we had to make this application a service which keeps running in the background irrespective of any users logged in.

I built the application into a service and after installation I am getting the following error when connecting to SyBase (please note the connection string is exactly same as used in the application)

ERROR [08001] [Sybase][ODBC Driver][SQL Anywhere]Database server not found

The project installer - service process installer 1 is configured as localsystem.

The creepiest thing here is, when the same application was not a service, connecting to sybase was successful. Once it was made into a service it started failing. I have a Windows 7 64-bit workstation and VS 2010.

I have been trying to do every single thing for the last one week to fix it but nothing seems to be working. Any advice would be highly appreciated.

Thanks,

Aaron

Accepted Solutions (0)

Answers (2)

Answers (2)

graeme_perrow
Advisor
Advisor

I suspect you are trying to connect with shared memory, which will not work when the server is running as a service. Make sure the server starts TCP (use the -x tcpip server switch), and then either add LINKS=tcpip or HOST=localhost (if using SQL Anywhere 12.x) to your connection string.

Update: As John said in his comment, shared memory will work if both the client and server are running as services. It's only if one of them is a service and the other is not that you need to use TCP/IP.

johnsmirnios
Advisor
Advisor
0 Kudos

It should work if both the client & the database server are services.

Former Member
0 Kudos

Not sure about the shared memory thing 😞

We often have trouble with services running as the "local service" account because that account by design does not have rights to do some things that typical users can do. We usually run into file access limitations (database cannot read/write files to a location because "local service" user does not have rights to that location).

I am not sure if this is applicable to your situation here, but it might help you narrow it down to run the application's service as a different user just to see if that changes the behavior.

Former Member
0 Kudos

Hi Siger,

I exactly thought that was happening. I have a DB file and connect using SQL Anywhere. I changed my service to get service login and ran it as the administrator, but still got the same error. Is there something I can do to overcome this limitation, any advice? thanks