dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Error at GetDefaultFolder(cdoDefaultFolderCalendar) in Windows 2003 Server

  1. #1
    Join Date
    Oct 2009
    Posts
    6

    Error at GetDefaultFolder(cdoDefaultFolderCalendar) in Windows 2003 Server

    Hi,

    I have a Visual Basic application built with CDO.dll, which updates
    appointments to OUTLOOK from a SQL db. The application is working perfectly
    fine in PCs which has WINDOWS XP, but fails in a PCs with WINDOWS 2003 Server.
    Below are three different scenarios, which I have used to test the
    application to connect with the EXCHANGE SERVER, from the said WINDOWS 2003
    Server PC thru VBA coding.

    Scenario 1 : Scenario in which the error occurs
    -------------------
    The below function returns an error at the statement Set oCalendar = oSession.
    GetDefaultFolder(CdoDefaultFolderCalendar), whereas the same statement
    executes perfectly fine if the code is, as in SCENARIO 3.
    Code:
    Public Function MapiLogon(ExchangeId As String, ExchangeServer As String) As
    MAPI.Session
       
       On Error GoTo ErrorHandler
       
       Dim sMsg As String
       Dim oSession As MAPI.Session
       Dim oCalendar As MAPI.Folder
       Dim sProfileInfo As String
       
       Set oSession = New MAPI.Session
       sProfileInfo = ExchangeServer & vbLf & ExchangeId
       Call oSession.Logon(, , False, , , , sProfileInfo)
       
       ' Verify that logon was successful
       
       Set oCalendar = oSession.GetDefaultFolder(CdoDefaultFolderCalendar)
       Set MapiLogon = oSession
       Exit Function
    
    ErrorHandler:
       txtResult = txtResult & vbCrLf & Err.Description
       Set oSession = Nothing
       
    End Function
    Scenario 2 : Scenario with no error
    -------------------
    The below function executes perfectly fine, if the GetDefaultFolder
    (CdoDefaultFolderInbox) is used.
    Code:
    Public Function MapiLogon(ExchangeId As String, ExchangeServer As String) As
    MAPI.Session
       
       On Error GoTo ErrorHandler
       
       Dim sMsg As String
       Dim oSession As MAPI.Session
       Dim oCalendar As MAPI.Folder
       Dim sProfileInfo As String
       
       Set oSession = New MAPI.Session
       sProfileInfo = ExchangeServer & vbLf & ExchangeId
       Call oSession.Logon(, , False, , , , sProfileInfo)
       
       ' Verify that logon was successful
       
       Set oCalendar = oSession.GetDefaultFolder(CdoDefaultFolderInbox)
       Set MapiLogon = oSession
       Exit Function
    
    ErrorHandler:
       txtResult = txtResult & vbCrLf & Err.Description
       Set oSession = Nothing
       
    End Function
    Scenario 3 : Scenario with no error
    -------------------
    The below function executes perfectly fine, if the statement Call oSession.
    Logon(, , True) is used, rather than the statement Call oSession.Logon(, ,
    False, , , , sProfileInfo).
    Code:
    Public Function MapiLogonwithProfileSelection(ExchangeId As String,
    ExchangeServer As String) As MAPI.Session
       
       On Error GoTo ErrorHandler
       
       Dim sMsg As String
       Dim oSession As MAPI.Session
       Dim oCalendar As MAPI.Folder
       Dim sProfileInfo As String
       
       Set oSession = New MAPI.Session
       Call oSession.Logon(, , True)
       
       ' Verify that logon was successful
       
       Set oCalendar = oSession.GetDefaultFolder(CdoDefaultFolderCalendar)
       Set MapiLogonwithProfileSelection = oSession
       Exit Function
    
    ErrorHandler:
       txtResult = txtResult & vbCrLf & Err.Description
       Set oSession = Nothing
       
    End Function
    I understand that this issue is due to CDO in WINDOWS 2003 Server, but not
    sure of why and what has to be done to rectify this error. I am a novice, so
    please briefly explain of, how this can be resolved.
    Last edited by Hack; 10-14-2009 at 07:14 AM. Reason: Added Code Tags

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    What is the specific error that you get?

  3. #3
    Join Date
    Oct 2009
    Posts
    6
    [Collaboration Data Objects - [MAPI_E_NOT_FOUND(8004010F)]]

  4. #4
    Join Date
    Oct 2009
    Posts
    6
    can anyone help me on this?

  5. #5
    Join Date
    Oct 2009
    Posts
    6
    Any help?

Similar Threads

  1. connecting to exchange server 2003 from vb.net
    By vasanthya_then in forum .NET
    Replies: 1
    Last Post: 04-17-2009, 04:15 AM
  2. Replies: 2
    Last Post: 09-03-2008, 08:03 AM
  3. SQL server 2005 - No windows connections
    By hospea in forum Database
    Replies: 0
    Last Post: 08-30-2007, 03:40 AM
  4. Replies: 2
    Last Post: 06-15-2007, 06:50 PM
  5. Windows application
    By stece in forum C++
    Replies: 6
    Last Post: 01-02-2006, 11:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center