Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Exchange
2000.active.directory
2000.admin
2000.announcements
2000.app.conversion
2000.applications
2000.clients
2000.clustering
2000.connectivity
2000.development
2000.documentation
2000.general
2000.information.store
2000.interop
2000.kms
2000.misc
2000.protocols
2000.realtime.collabo.
2000.setup
2000.transport
2000.win2000
admin
application.conversion
applications
clients
clustering
connectivity
design
development
misc
mobility
setup
tools
  
 
date: Fri, 11 Jan 2008 05:39:36 -0800 (PST),    group: microsoft.public.exchange2000.development        back       


Object cannot be created at this URL because an object named by this URL already exists   
Hi All,
I want to develop one application in vb.net for exchange 2000.

I tried to add one contact with the code snippet below. The same logic
is there for appointment on Microsoft's site.
(I added Microsoft CDO exchange library for 2000 & activex data object
2.5 reference to the project)

        Dim sURL As String
        sURL = "http://sbsserver/Exchange/trial/contacts"

        Dim oCn As ADODB.Connection = New ADODB.Connection()
        ' For server change oCn.Provider to "exoledb.datasource";
        oCn.Provider = "exoledb.datasource"

        oCn.Open(sURL, "", "", 0)
        If oCn.State = 1 Then
            Console.WriteLine("Good Connection")
        Else
            Console.WriteLine("Bad Connection")
            Return
        End If

        Dim iConfg As CDO.Configuration = New CDO.Configuration()
        Dim oFields As ADODB.Fields

        oFields = iConfg.Fields
        oFields.Item(CDO.CdoCalendar.cdoTimeZoneIDURN).Value =
CDO.CdoTimeZoneId.cdoPacific
        ' TODO: Set Meeting Organizer
        oFields.Item(CDO.CdoConfiguration.cdoSendEmailAddress).Value =
"organizer@example.com"
        oFields.Update()

' Below is my code in which I just removed the logic of creation of
appointment with creation of contact

Dim oContact As New CDO.Person
' ***************************************
oContact.FirstName = "FirstTrial"
oContact.LastName = "LastTrial"
oContact.Configuration = iConfg

oContact.DataSource.SaveTo sURL, , _
         ADODB.ConnectModeEnum.adModeReadWrite, _
         ADODB.RecordCreateOptionsEnum.adCreateNonCollection, _
         ADODB.RecordOpenOptionsEnum.adOpenSource, _
         "", ""
oContact = Nothing

        oCn.Close()
        oCn = Nothing
        oFields = Nothing
' ***************************************

Now here if I run the program for first time, my contact is
successfully get created in the trial's contacts folder. But if I run
this program second time, it gives me error "Object cannot be created
at this URL because an object named by this URL already exists". On
some forum, the solution to error is given as - Try to create the
contact with readWrite & Overwrite attribs. So I changed the above
creation code from
"ADODB.RecordCreateOptionsEnum.adCreateNonCollection" to
"ADODB.RecordCreateOptionsEnum.adCreateOverwrite". But it gives me the
error as "Unspecified error". So how I can create a contact or modify
existing contact in the trial's mailbox?
Further how I can create the task for Trial using similar code above?
Also please anyone point me to the right direction where I can get the
knowledge about step by step exchange programming on the internet?

Thanks in advance
date: Fri, 11 Jan 2008 05:39:36 -0800 (PST)   author:   Dhananjay

Re: Object cannot be created at this URL because an object named by this URL already exists   
Hi,

to modify an existing contact, open the contact item first:


Dim oContact As New CDO.Person

oContact.DataSource.Open sUrl, connection....
 oContact.FirstName = "FirstTrial"
 oContact.LastName = "LastTrial"
 oContact.Configuration = iConfg
 
oContact.Save
 
Kind regards,
Henning Krause

> oContact.DataSource.SaveTo sURL, , _
>         ADODB.ConnectModeEnum.adModeReadWrite, _
>         ADODB.RecordCreateOptionsEnum.adCreateNonCollection, _
>         ADODB.RecordOpenOptionsEnum.adOpenSource, _
>         "", ""
> oContact = Nothing
> 
>        oCn.Close()
>        oCn = Nothing
>        oFields = Nothing
> ' ***************************************
> 
> Now here if I run the program for first time, my contact is
> successfully get created in the trial's contacts folder. But if I run
> this program second time, it gives me error "Object cannot be created
> at this URL because an object named by this URL already exists". On
> some forum, the solution to error is given as - Try to create the
> contact with readWrite & Overwrite attribs. So I changed the above
> creation code from
> "ADODB.RecordCreateOptionsEnum.adCreateNonCollection" to
> "ADODB.RecordCreateOptionsEnum.adCreateOverwrite". But it gives me the
> error as "Unspecified error". So how I can create a contact or modify
> existing contact in the trial's mailbox?
> Further how I can create the task for Trial using similar code above?
> Also please anyone point me to the right direction where I can get the
> knowledge about step by step exchange programming on the internet?
> 
> Thanks in advance
date: Fri, 11 Jan 2008 21:10:09 +0100   author:   Henning Krause [MVP - Exchange]

Re: Object cannot be created at this URL because an object named by this URL already exists   
Thanks Henning for your reply. Let me try & update the forum.

On Jan 12, 1:10 am, "Henning Krause [MVP - Exchange]"
 wrote:
> Hi,
>
> to modify an existing contact, open the contact item first:
>
> Dim oContact As New CDO.Person
>
> oContact.DataSource.Open sUrl, connection....
>  oContact.FirstName = "FirstTrial"
>  oContact.LastName = "LastTrial"
>  oContact.Configuration = iConfg
>
> oContact.Save
>
> Kind regards,
> Henning Krause
>
> > oContact.DataSource.SaveTo sURL, , _
> >         ADODB.ConnectModeEnum.adModeReadWrite, _
> >         ADODB.RecordCreateOptionsEnum.adCreateNonCollection, _
> >         ADODB.RecordOpenOptionsEnum.adOpenSource, _
> >         "", ""
> > oContact = Nothing
>
> >        oCn.Close()
> >        oCn = Nothing
> >        oFields = Nothing
> > ' ***************************************
>
> > Now here if I run the program for first time, my contact is
> > successfully get created in the trial's contacts folder. But if I run
> > this program second time, it gives me error "Object cannot be created
> > at this URL because an object named by this URL already exists". On
> > some forum, the solution to error is given as - Try to create the
> > contact with readWrite & Overwrite attribs. So I changed the above
> > creation code from
> > "ADODB.RecordCreateOptionsEnum.adCreateNonCollection" to
> > "ADODB.RecordCreateOptionsEnum.adCreateOverwrite". But it gives me the
> > error as "Unspecified error". So how I can create a contact or modify
> > existing contact in the trial's mailbox?
> > Further how I can create the task for Trial using similar code above?
> > Also please anyone point me to the right direction where I can get the
> > knowledge about step by step exchange programming on the internet?
>
> > Thanks in advance
date: Mon, 14 Jan 2008 05:48:46 -0800 (PST)   author:   Dhananjay

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us