|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 ------------------- 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 ------------------- 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 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 |
|
#2
|
||||
|
||||
|
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 |
|
#3
|
|||
|
|||
|
[Collaboration Data Objects - [MAPI_E_NOT_FOUND(8004010F)]]
|
|
#4
|
|||
|
|||
|
can anyone help me on this?
|
|
#5
|
|||
|
|||
|
Any help?
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
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 |