Solved

Acessing CDO while program is a service on Win 2000

Posted on 2002-05-29
8
182 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 142

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
 
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now