Top DevX Stories
Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Search the forums:

Go Back   DevX.com Forums > DevX Developer Forums > VB Classic

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 10-14-2009, 08:01 AM
avis_sivakumar avis_sivakumar is offline
Registered User
 
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 08:14 AM. Reason: Added Code Tags
Reply With Quote
  #2  
Old 10-14-2009, 08:14 AM
Hack's Avatar
Hack Hack is offline
Super Moderator
 
Join Date: Apr 2007
Location: Sterling Heights, Michigan
Posts: 7,719
What is the specific error that you get?
__________________
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista

Microsoft MVP 2005/2006/2007/2008/2009
Reply With Quote
  #3  
Old 10-14-2009, 08:23 AM
avis_sivakumar avis_sivakumar is offline
Registered User
 
Join Date: Oct 2009
Posts: 6
[Collaboration Data Objects - [MAPI_E_NOT_FOUND(8004010F)]]
Reply With Quote
  #4  
Old 10-20-2009, 06:39 AM
avis_sivakumar avis_sivakumar is offline
Registered User
 
Join Date: Oct 2009
Posts: 6
can anyone help me on this?
Reply With Quote
  #5  
Old 11-10-2009, 07:35 AM
avis_sivakumar avis_sivakumar is offline
Registered User
 
Join Date: Oct 2009
Posts: 6
Any help?
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
connecting to exchange server 2003 from vb.net vasanthya_then .NET 1 04-17-2009 05:15 AM
Windows Server 2003 - Windows Service runs batch file razovy .NET 2 09-03-2008 09:03 AM
SQL server 2005 - No windows connections hospea Database 0 08-30-2007 04:40 AM
Problems using CSocket on Windows Server 2003 DigCamara C++ 2 06-15-2007 07:50 PM
Windows application stece C++ 6 01-02-2006 11:22 AM


All times are GMT -4. The time now is 02:15 AM.


Sponsored Links



Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.