exchangefreaks.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Object cannot be created at this URL because an object named

 
Post new topic   Reply to topic    exchangefreaks.com Forum Index -> MS Exchange 2000 Development
Author Message
Dhananjay



Joined: 11 Jan 2008
Posts: 5

PostPosted: Fri Jan 11, 2008 10:39 am    Post subject: Object cannot be created at this URL because an object named Reply with quote

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

Archived from group: microsoft>public>exchange2000>development
Back to top
View user's profile Send private message
Henning Krause [MVP - Exc



Joined: 05 Aug 2007
Posts: 142

PostPosted: Sat Jan 12, 2008 2:10 am    Post subject: Re: Object cannot be created at this URL because an object n Reply with quote

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
Back to top
View user's profile Send private message
Dhananjay



Joined: 11 Jan 2008
Posts: 5

PostPosted: Mon Jan 14, 2008 10:48 am    Post subject: Re: Object cannot be created at this URL because an object n Reply with quote

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

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
There is a naming violation - Creating a contact object Hi Experts... Anyone could help me? I´m getting this error when I try to create a new contact object on AD / Exchange using special characters on Common Name: {"There is a naming violation." }

Accessing the Private field of a contact/IPerson object I am trying to apply a filter on Contacts of either a private store or Public Folder where I only return items that are not marked private. The code (server-side application) is running under an account that has access to other person's mailbox. The filte

WEBDAV: how to get a Multiline body in webdav created appoin I am using webdav to create an appointment and post it to a clanedar. When I pass a regular string with carriage returns and linefeeds to the field they do not display. If I try to pass an html formatted string in the fie

Object Picker cannot open i'm trying to track messages in my front-end server, whenever i try to click on the server button to choose my front-end server it doesn't allow me and give me this error message "Object Picker cannot open becuase no locations from which to choose" becuas

Exchange Object in AD Sites and Services I had 4 domain controllers and retired 2 of them, due to old hardware. They were the first DCs in the domain. In Sites and Services, I still see those servers referenced. I deleted one of them, which had nothing underneath of it. The other reference to a
Post new topic   Reply to topic    exchangefreaks.com Forum Index -> MS Exchange 2000 Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group