How to "Unlock" a Data source? - InfoPath Dev
in

InfoPath Dev

How to "Unlock" a Data source?

Last post 06-18-2010 03:10 PM by Hilary Stoupa. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 10-28-2008 06:46 AM

    How to "Unlock" a Data source?

    Hi!

    I encountered a problem trying to add fields to an existing data source. Somehow, this particular data source and its corresponding fields are "locked". Consequently, InfoPath would not let me make any modifications to the data source.

    Does anybody know how to "unlock" a data source?

    Thanks in advance for your help!

     

  • 10-28-2008 07:18 AM In reply to

    Re: How to "Unlock" a Data source?

    Are you talking about creating a main data source from an existing schema?  If so, you'll need to insert an <xsd:any> node into the appropriate place in the schema.

    I don't think you can use the InfoPath designer to modify the schemas of secondary data sources, if that's what you're asking about.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 10-29-2008 12:51 AM In reply to

    Re: How to "Unlock" a Data source?

    Hi,

    You cannot do any modifications in the secondary data source schema . So for modifing the secondary data source schema you need to modify the xsd of the corresponding schema .

    Chandrakanth/GGKTech
  • 10-29-2008 06:46 AM In reply to

    Re: How to "Unlock" a Data source?

    Hi!

    Thanks for your response. Actually, I am talking about my "main" data source which is locked. Somedoby else coded this application that I now "inherited" and I am trying to unlock the data source to add fields.

    Do you know if this is feasible?

    Thank you! 

  • 10-29-2008 07:29 AM In reply to

    Re: How to "Unlock" a Data source?

    It is feasible -- Jimmy's post above has the gist of the matter. You'll need to do the following:

    Save your form as source files
    Find the main schema (.xsd) file for the form (default is 'myschema.xsd')
    Modify the schema to include an xsd:any node where you want to be able to add elements
    Open the manifest.xsf in design mode and 'Save As' to repack your template

    One way to get a feel for the schema structure would be to create a blank form, add some fields to it, save as source files, and look at the schema. Compare that to your schema, and see the difference. For example, myschema.xsd when the schema is created in the form looks like:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <xsd:schema targetNamespace="http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-10-29T14:17:07" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-10-29T14:17:07" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <xsd:element name="myFields">
                <xsd:complexType>
                      <xsd:sequence>
                            <xsd:element ref="my:field1" minOccurs="0"/>
                            <xsd:element ref="my:field2" minOccurs="0"/>
                            <xsd:element ref="my:field3" minOccurs="0"/>
                      </xsd:sequence>
                      <xsd:anyAttribute processContents="lax" namespace="http://www.w3.org/XML/1998/namespace"/>
                </xsd:complexType>
          </xsd:element>
          <xsd:element name="field1" type="xsd:string"/>
          <xsd:element name="field2" type="xsd:string"/>
          <xsd:element name="field3" type="xsd:string"/>
    </xsd:schema>

    You can see where the xsd:anyAttribute node has been added.

    Do make sure you keep a backup copy of your form before modifying template files -- better safe than sorry!

     

    Hilary Stoupa

  • 06-18-2010 01:36 PM In reply to

    • kclark
    • Not Ranked
    • Joined on 06-18-2010
    • Posts 7

    Re: How to "Unlock" a Data source?

    Hi I am new...I don't readily understand.  I see the node but isn't there supposed to be an end tag???

  • 06-18-2010 01:51 PM In reply to

    Re: How to "Unlock" a Data source?

    Hi -- I'm a bit confused by what you mean by an "end tag"? Where do see one missing?

    Hilary Stoupa

  • 06-18-2010 01:54 PM In reply to

    • kclark
    • Not Ranked
    • Joined on 06-18-2010
    • Posts 7

    Re: How to "Unlock" a Data source?

    I only see one here <xsd: anyAttribute> 

    <xsd:anyAttribute processContents="lax" namespace="http://www.w3.org/XML/1998/namespace"/>

  • 06-18-2010 03:10 PM In reply to

    Re: How to "Unlock" a Data source?

    Note the end of the tag? /> -- it is closed.

    Hilary Stoupa

Page 1 of 1 (9 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.