Solved

Acessing CDO while program is a service on Win 2000

Posted on 2002-05-29
8
192 Views
Last Modified: 2010-05-02
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
0
Comment
Question by:adinas
8 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 200 total points
ID: 7041929
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
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7041955
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
 
LVL 1

Author Comment

by:adinas
ID: 7041971
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:adinas
ID: 7041977
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
 
LVL 26

Expert Comment

by:EDDYKT
ID: 7042044
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
 

Expert Comment

by:Jgould
ID: 7216691
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
 
LVL 1

Author Comment

by:adinas
ID: 7217003
That is OK with me.
0
 

Expert Comment

by:Jgould
ID: 7217184
thanks
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question