Form error - InfoPath Dev
in

InfoPath Dev

Form error

Last post 04-21-2006 08:17 AM by Matt Faus. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 04-19-2006 09:34 AM

    • bashira
    • Not Ranked
    • Joined on 01-12-2006
    • United Kingdom
    • Posts 16

    Form error

    I have a simply form which i am testing to see if i can get some vb code working.

    the form has three fields, fname, sname, username, and a button with custom code as

    dim sFirstname, sSurname, sUsername

    sFirstname = XDocument.DOM.selectSingleNode("//my:myFields/my:firstname").text
    sSurname = XDocument.DOM.selectSingleNode("//my:myFields/my:surname").text
    sUsername = XDocument.DOM.selectSingleNode("//my:myFields/my:username").text

    msgbox " Checking for " & sfirstname & " " & sSurname

    'Setup Active Directory Connection Properties

    Set conn = CreateObject("ADODB.Connection")
    conn.Provider = "ADSDSOObject"
    conn.Open "ADs Provider"

    sLdap = "<LDAP://dc=siemensfinancialservices,dc=co,dc=uk>;(&(objectCategory=User)(distinguishedName=*)(samAccountName=" & sUsername & "));distinguishedName;subtree"
    Set rs = conn.Execute(sLdap)
    If rs.RecordCount = 0 Then
    Msgbox "Username: " & sUserName & " does not exist."
    Else
    sUserDN = rs.fields("distinguishedName")
    Msgbox DomainContainer
    Set oUser = GetObject("LDAP://" & sUserDN)
    oUser.msExchHideFromAddressLists = True
    oUser.userAccountControl = "514"
    oUser.SetInfo
    If oUser.userAccountControl = "514" Then
    sAS = "Disabled"
    Elseif oUser.userAccessControl = "512" Then
    sAS = "Enabled"
    End If
    Msgbox "User: " & sUserDN & vbcrlf & "Hide From GAL? " & oUser.Get("msExchHideFromAddressLists") & vbcrlf & "Account is: " & sAS
    Set oUser = Nothing
    End If

    conn.close

    I receive a an error ActiveX component cant create object: 'Get Object'

    File: script.vbs
    Line41


    I get this error wheather i publish to sharepoint or to a shared folder.

    I have also tried different trusts, such as fully trust, domain and automatically detect.

    Please can some one tell me where i am going wrong.

    Some information :http://support.microsoft.com/default.aspx?scid=kb;en-us;832512

    Thanks
  • 04-19-2006 09:32 PM In reply to

    Hi Bashira,

    Setting the form to full trust should resolve the problem, but are you installing an MSI (via Regform) or using digital signatures?

    Is the URL for www.SiemensFinancialServices.co.uk added to the Trusted Sites in your IE security settins.

    Patrick Halstead
    Project Manager at Qdabra
  • 04-20-2006 12:19 AM In reply to

    • bashira
    • Not Ranked
    • Joined on 01-12-2006
    • United Kingdom
    • Posts 16
    Patrick,

    thanks for your reply.

    I have set the form trust to fully trusted (tools>form options>security)

    I wll add the url and check.

    I have not yet installed the form.

    Can you advise or refer me on a guide to using regform?

    Thanks

  • 04-20-2006 01:18 AM In reply to

    • bashira
    • Not Ranked
    • Joined on 01-12-2006
    • United Kingdom
    • Posts 16
    Hi Patrick,

    I have now successfully used the regform tool to create an msi, and have installed the form in c:\program files\infopath form templates

    When i double click on the xsn file, and click the button, i get the error

    The following error occurred:

    Safety settings on this computer prohibit accessing a data source on another domain.
    File:script.vbs
    Line:32

    any ideas?
  • 04-20-2006 06:08 AM In reply to

    Hi bashira,

    I believe you can control this simply by adjusting a browser setting.

    Using IE6, look under "Tools", "Internet Options", Security tab, the appropriate zone, and then Custom Level. In the Miscellaneous section, enable the "Access data sources across domains".

    Hope that helps...
    Karsten
  • 04-21-2006 12:33 AM In reply to

    • bashira
    • Not Ranked
    • Joined on 01-12-2006
    • United Kingdom
    • Posts 16
    hi,

    thanks for that, i did try it but i keep getting

    The following error occurred:

    Safety settings on this computer prohibit accessing a data source on another domain.
    File:script.vbs
    Line:33

    do i need to re-register the form after i have made the changes?

  • 04-21-2006 01:28 AM In reply to

    Hi again,
    You've done everything that you need to. The only remaining thing I can think of is some kind of Windows security policy.
    Patrick Halstead
    Project Manager at Qdabra
  • 04-21-2006 03:26 AM In reply to

    • bashira
    • Not Ranked
    • Joined on 01-12-2006
    • United Kingdom
    • Posts 16
    Patrick,

    do you have any idea as to where i need to look in group policy?

    is there an alternative i could use?

    The reason why i am creating this form is to allow manager to fill out a leavers form when a user leaves the company. Once they submitt the form, it should for example, disable their Active Directory Account, Remove any Group Memberships, Remove user fom GAL etc...

    Any ideas?
  • 04-21-2006 07:21 AM In reply to

    Hi bashira,

    this error is caused by cross-domain settings on the local computer and occurs when accessing data across domains is not allowed. Note that "domain" refers to Internet/Intranet domain, and not to network domain.

    I would suggest to make a web service -or even take the one from this site- to access your Active Directory and bind the web service as a secondary data source to your form.

    I´ve done this for a few times now and it works really fine.

    For any further information please don´t hesitate to ask...

    Regards,
    Karsten
  • 04-21-2006 07:33 AM In reply to

    • bashira
    • Not Ranked
    • Joined on 01-12-2006
    • United Kingdom
    • Posts 16
    Would the web service allow me to add user accounts/computers and make chnages to existing accounts? ie disable accounts

    This is the main feature i am looking for in the form i am designing

    Thanks
  • 04-21-2006 08:17 AM In reply to

    You can read the active directory stuff from InfoPath, but I don't think editing Windows Network User Accounts is going to be an easy task from within something like InfoPath. It seems like the only way to do this is through the wizards built in to Windows. You might be able to cook up some sly javascript files that could do what you're thinking, but I wouldn't even know where to start on those.

    If you figure out how to do this, please let us know, this is very interesting!
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (11 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.