ADO and Win32 Services

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: me (me_at_me.me)
Date: 03/22/05


Date: Tue, 22 Mar 2005 16:17:17 +0200

Hi everyone,

I've wondered across a peculiar issue with ADO (although something else
could be the culprit, but through my investigation, I believe it to be ADO).

I have written a service that uses ADO. When running the service as a
console app, everything works great. However, when the service is run 'as a
service' in the SCM, I find a problem with the connection.

Basically, this is what I've found to happen:

1. I issue a connect() call, and it returns S_OK.
2. Immediately after that, I execute a simple query, say "select count(*)
from table1". At this point, when running as a normal app, the query
executes and all is well. However, as a service, the query fails. Upon
further inspection, doing a check on whether the connection is actually
"connected", I find that it is infact disconnected.

Any ideas? I've been thrashing my brains with this problem for a few hours
now. Maybe someone can shed some light on this?

I have tried changing the account under which the service runs. That didn't
work. I tried testing different data providers. Same problem. Anything else
I can try?

Thanks,
Peter



Relevant Pages

  • Re: Delphi ADO databse newbie question
    ... I use ADO and Delphi has some great TADO wrappers, Check out the ADO page on ... I would use a datamodule and call it something like ... Drop a TADOQuery on your datamodule and set the connection property to ... When the active property of the query object is set to true all your records ...
    (alt.comp.lang.borland-delphi)
  • Re: Problem with Deletes in code
    ... DoCmd.RunSQL to execute the delete query. ... 'All records in rsSourceProjects will be for the same project, ... problem with ADO interacting with the tables, ...
    (microsoft.public.access.modulesdaovba)
  • Re: Interesting Problem regarding Parameters
    ... > reasons, however we have one slight problem we would very much like to ... > logging to our database connection object. ... > query that was actually executed on the server, what I mean by that is: ... > //Set the query with parmater then execute reader ...
    (microsoft.public.dotnet.framework.adonet)
  • Interesting Problem regarding Parameters
    ... My company is currently migrating to .Net from PHP for a number of reasons, ... database connection object. ... What our current database class will do (after executing the query) is logg ... //Set the query with parmater then execute reader ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Create View, Index
    ... Some of these depend on the library you use to execute the query, i.e. they might work only if executed under ADO (not DAO.) ... Here's an exmaple of how to create a view with ADO: ...
    (microsoft.public.access.queries)