Acessing CDO while program is a service on Win 2000

Hi,

I created a progam that logs onto an Exchange server using CDO 1.21 using the following code:
set CDOSession = new MAPI.Session
CDOSession.Logon "MyProfile",,False,False,0,True

Anyway, it works fine when I run it. But I need to run it as a service. so I used Microsft's tools instsrv.exe and srvany.exe to turn my exe into an NT service. The problem is that now I get a MAPI_E_LOGON_FAILED error whenever I manually start the service.

Anybody know why the logon acts differently when run from a service?

Adin
LVL 1
adinasAsked:
Who is Participating?
 
TimCotteeConnect With a Mentor Head of Software ServicesCommented:
I would imagine that the service is logging on as LocalSystem. If you can configure the service to log on as a Domain User account rather than LocalSystem it may work.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I can confirm that the service will need to run under an NT account, probably YOUR account to have access to the profile information.

CHeers
0
 
adinasAuthor Commented:
I tried it using my account too.

In the 'Log On' tab of the service properties I chose 'This account' and used my username and password. I also tried using the admin username and password, in both cases I still got the Logon failed error
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
adinasAuthor Commented:
I tried it using my account too.

In the 'Log On' tab of the service properties I chose 'This account' and used my username and password. I also tried using the admin username and password, in both cases I still got the Logon failed error
0
 
EDDYKTCommented:
I wonder how your program find your profile even you run your program as specific user.

The reason is the system doesn't know how to map your specific user to HKEY_CURRENT_USER
0
 
JgouldCommented:
Hi adinas,

could you explain the C grade here?

the guidelines
http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp

if there's no further addition then i'll upgrade it to 'A' since the comment seems to answer the question

a bit terse maybe but that's why it was a comment and no answer if you need more help then please ask for it first

Thanks
**JGould-EE Moderator**
0
 
adinasAuthor Commented:
That is OK with me.
0
 
JgouldCommented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.