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
Solved

Acessing CDO while program is a service on Win 2000

Posted on 2002-05-29
8
190 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
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.

 
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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 I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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…

791 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