Results 1 to 2 of 2

Thread: Invalid Cast (objMailbox = objADSIuser) CDOEXM.DLL

  1. #1
    PokerJoker Guest

    Invalid Cast (objMailbox = objADSIuser) CDOEXM.DLL

    I've recently created a "new employee" form that creates accounts, mailboxes,
    and the like.

    On my development box (xp pro), the code works fine. However, now that I am
    trying to move the code to the production server (2003), I am running into
    the following error.

    Invalid Cast Specified (see comment for line)

    Here is the code

    Dim objMailbox As CDOEXM.IMailboxStore
    Dim objADSIuser As ActiveDs.IADsUser

    'Bind User to AD
    objADSIuser = GetObject(ADSIUserPath)
    objMailbox = objADSIuser 'HAPPENS ON THIS LINE!
    objMailbox.CreateMailbox("LDAP://" & DCServer & "/" & _
    "CN=Mailbox Store (" & DCServer1 & ")," & _
    "CN=Blah," & _
    "CN=InformationStore," & _
    "CN=" & DCServer1 & "," & _
    "CN=Servers," & _
    "CN=blah," & _
    "CN=Administrative Groups," & _
    "CN=blah," & _
    "CN=Microsoft Exchange," & _
    "CN=Services," & _
    "CN=Configuration," & DomainName)
    objADSIuser.SetInfo()

    Please advise!

  2. #2
    PokerJoker Guest
    Nobody has any info?

    "PokerJoker" wrote:

    I've recently created a "new employee" form that creates accounts, mailboxes,
    and the like.

    On my development box (xp pro), the code works fine. However, now that I am
    trying to move the code to the production server (2003), I am running into
    the following error.

    Invalid Cast Specified (see comment for line)

    Here is the code

    Dim objMailbox As CDOEXM.IMailboxStore
    Dim objADSIuser As ActiveDs.IADsUser

    'Bind User to AD
    objADSIuser = GetObject(ADSIUserPath)
    objMailbox = objADSIuser 'HAPPENS ON THIS LINE!
    objMailbox.CreateMailbox("LDAP://" & DCServer & "/" & _
    "CN=Mailbox Store (" & DCServer1 & ")," & _
    "CN=Blah," & _
    "CN=InformationStore," & _
    "CN=" & DCServer1 & "," & _
    "CN=Servers," & _
    "CN=blah," & _
    "CN=Administrative Groups," & _
    "CN=blah," & _
    "CN=Microsoft Exchange," & _
    "CN=Services," & _
    "CN=Configuration," & DomainName)
    objADSIuser.SetInfo()

    Please advise!

Similar Threads

  1. vb.net Outlook Cast Not Valid - Problems with items in Publi
    By Chris Thunell in forum Connectivity
    Replies: 3
    Last Post: 04-22-2005, 10:57 AM
  2. Looping through Outlook Contacts gives me a 'Invalid Cast Ex
    By Chris Thunell in forum Connectivity
    Replies: 7
    Last Post: 04-21-2005, 10:40 AM
  3. CDOEXM error
    By I. Kinal in forum Development
    Replies: 5
    Last Post: 04-10-2005, 05:59 AM
  4. INVALID HEADER (INVALID CHARACTERS OR SPACE GAP)
    By Pat in forum Administration
    Replies: 2
    Last Post: 02-08-2005, 04:13 PM
  5. Using CDOEXM
    By Raj in forum Development
    Replies: 1
    Last Post: 01-24-2005, 06:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other forums: Access Forum - Microsoft Office Forum - CAD Forum