Solved

Acessing CDO while program is a service on Win 2000

Posted on 2002-05-29
8
196 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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

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!

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…

688 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