Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - selecting default data provider
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

selecting default data provider

 Post Reply Post Reply
Author
Message
timcpa View Drop Down
Newbie
Newbie


Joined: 27 August 2006
Location: United States
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote timcpa Quote  Post ReplyReply Direct Link To This Post Topic: selecting default data provider
    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
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
timcpa View Drop Down
Newbie
Newbie


Joined: 27 August 2006
Location: United States
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote timcpa Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
timcpa View Drop Down
Newbie
Newbie


Joined: 27 August 2006
Location: United States
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote timcpa Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2006 at 8:22pm
any answer for the last post?
tim
Back to Top
timcpa View Drop Down
Newbie
Newbie


Joined: 27 August 2006
Location: United States
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote timcpa Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2006 at 8:41pm
Originally posted by sserge 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
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
nariofox View Drop Down
Newbie
Newbie


Joined: 09 October 2006
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote nariofox Quote  Post ReplyReply Direct Link To This Post 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


Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.