selecting default data provider
Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=4893
Printed Date: 16 November 2024 at 10:02am Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: selecting default data provider
Posted By: timcpa
Subject: selecting default data provider
Date Posted: 27 August 2006 at 1:19pm
Where in the code can the default data provider be set upon running the sample? I want to default to MAPI outlook, so this is the data source when running the sample.
Whenever MAPI is selected in the sample, it causes an error when the program stops running in VB and even after the program is compiled upon exiting the sample and error is displayed. Is there a fix that is causing this system error>
------------- tim
|
Replies:
Posted By: sserge
Date Posted: 27 August 2006 at 3:24pm
To open MAPI data provider it is enough on form loading setup it in a following way: CalendarControl.SetDataProvider "Provider=MAPI;"
And open it: CalendarControl.DataProvider.Open
There should not be any errors when using it. It would be better if you submit your crash report into support area http://www.codejock.com/support/ with as much details as possible.
-- Regards, Serge
|
Posted By: timcpa
Date Posted: 27 August 2006 at 8:30pm
That works fine, but would like to not be prompted for the "Choose Profile". Tried setting the default option in the dialog, but this does nothing in regards to setting as the default profile.
Thanks in advance.
------------- tim
|
Posted By: timcpa
Date Posted: 28 August 2006 at 8:22pm
any answer for the last post?
------------- tim
|
Posted By: timcpa
Date Posted: 28 August 2006 at 8:41pm
sserge wrote:
To open MAPI data provider it is enough on form loading setup it in a following way: CalendarControl.SetDataProvider "Provider=MAPI;"
And open it: CalendarControl.DataProvider.Open
There should not be any errors when using it. It would be better if you submit your crash report into support area http://www.codejock.com/support/ with as much details as possible.
-- Regards, Serge
|
That works fine, but would like to not be prompted for the "Choose
Profile". Tried setting the default option in the dialog, but this
does nothing in regards to setting as the default profile.
Thanks in advance.
------------- tim
|
Posted By: sserge
Date Posted: 31 August 2006 at 4:55pm
There was no answer because for now this is not possible...
This "Choose Profile" dialog is shown by MAPI itself, and this "set default" button never worked there.
Dialog will not be shown if only a MAPI session is already open, for example when Outlook is opened.
For future will add a possibility to specify a name of the profile for this dialog, something like "Provider=MAPI;ProfileName=Somename;"
-- WBR, Serge
|
Posted By: nariofox
Date Posted: 09 October 2006 at 11:02pm
First Add a Reference to Microsoft CDO 1.21 (Collobaration Data Object)
Use the following code
private sub Form_Load()
Dim objSession As MAPI.Session Dim MAPISession As Outlook.NameSpace Set objSession = CreateObject("MAPI.Session") Set MAPISession = Application.Session If Not MAPISession Is Nothing Then MAPISession.Logon , , True, False End If OpenProvider cjCalendarData_MAPI, "Provider=MAPI"
end sub
Public Sub OpenProvider(ByVal eDataProviderType As CodeJockCalendarDataType, ByVal strConnectionString As String) CalendarControl.SetDataProvider strConnectionString If Not CalendarControl.DataProvider.Open Then CalendarControl.DataProvider.Create End If CalendarControl.Populate Exit Sub End Sub
|
|