File: xdobjDataObject.htm

package info (click to toggle)
office2003-schemas 1.0%2Bds-1
  • links: PTS, VCS
  • area: non-free
  • in suites: bookworm, forky, sid, trixie
  • size: 42,304 kB
  • sloc: javascript: 2,429; makefile: 29
file content (23 lines) | stat: -rw-r--r-- 5,951 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<html dir="ltr"><head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="assetid" CONTENT="HV01024616"><META NAME="lcid" CONTENT="1033"><title>DataObject Object</title><link rel="stylesheet" type="text/css" href="office10.css"><script type="text/javascript" language="Javascript" src="ExpCollapse.js"></script><script type="text/javascript" language="JavaScript" src="inline.js"></script></head><body><p id="ExpandAllLine" class="ExpFav"><a href="#" onclick="ExpandAll()" onkeypress="ExpandAll()" class="DropDown"><img id="picHeader" border="0" src="expandtri.gif" alt="Show All"><span id="ExpandAll">Show All</span></a></p><h1>DataObject Object</h1><div class="ofvbanav"><span class="ofvbanavreuse" id="seealso" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="properties" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="methods" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="events" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="specifics" onclick="toggleList()" onkeypress="toggleList()"></span></div><table class="ofvbaomart"><tr><td class="noborder" nowrap="true"><A HREF="xdcolDataObjects.htm" title="DataObjects"><SPAN tabindex="0" class="omyellow" id="ParentObject">DataObjects</SPAN></A><BR /><IMG SRC="../img/parchild.gif" BORDER="0"></IMG><A HREF="xdobjDataObject.htm" title="DataObject"><SPAN class="omblue">DataObject</SPAN></A><br /></td></tr></table><p>Represents a link to the data adapter of a  <a href="#" class="glossary" onclick="AppendPopup(this,'xdsecondarydatasource')" onkeypress="AppendPopup(this,'xdsecondarydatasource')">secondary data source</a>. The <b class="bterm">DataObject</b> object acts as an intermediary between a Microsoft Office InfoPath 2003 form and the <a href="#" class="glossary" onclick="AppendPopup(this,'xddataadapter')" onkeypress="AppendPopup(this,'xddataadapter')">data adapter</a> object that is used to access data that is contained in an external data source.</p><p>The <b class="bterm">DataObject</b>
			object provides properties and methods that can be used to programmatically interact with data adapter objects, including retrieving information about the data adapter objects and accessing the data that they connect to. The <b class="bterm">DataObject</b> object  is accessible through the <b class="bterm"><a href="xdproDataObjects.htm" id="HV01021279" lcid=" ">DataObjects</a></b> property of the <b class="bterm"><a href="xdobjXDocument.htm" id="HV01021254" lcid=" ">XDocument</a></b> object.</p><h2>Remarks</h2><p>An external data source can take the form of a Microsoft Access or Microsoft SQL Server database, an .xml file, or an XML Web service. The type of data adapter object used to access the external data source depends on the type of data source. The <b class="bterm">DataObject</b> object provides a common set of properties and a method that can be used for all types of data adapter objects, and each of the data adapter objects provides
			its own set of properties and methods.</p><p>Microsoft Office InfoPath 2003 supports three types of data adapters:<ol><li><b class="runinhead">ActiveX Data Objects</b>   Represented by the <b class="bterm"><a href="xdobjADOAdapter.htm" id="HV01021238" lcid=" ">ADOAdapter</a></b> object.</li><li><b class="runinhead">Web services</b>   Represented by the <b class="bterm"><a href="xdobjWebServiceAdapter.htm" id="HV01021251" lcid=" ">WebServiceAdapter</a></b> object.</li><li><b class="runinhead">XML file</b>   Represented by the <b class="bterm"><a href="xdobjXMLFileAdapter.htm" id="HV01021255" lcid=" ">XMLFileAdapter</a></b> object.</li></ol></p><h2>Using the DataObject object</h2><p>In the following code sample, the name of the secondary data source is passed to the <b class="bterm"><a href="xdproItem_7.htm" id="HV01021304" lcid=" ">Item</a></b> property of the <b class="bterm"><a href="xdcolDataObjects.htm" id="HV01021185" lcid=" ">DataObjects</a></b> collection, which returns a reference to the <b class="bterm">DataObject</b> object, which, in this case, is associated with an <b class="bterm">ADOAdapter</b> data adapter object. Using the <b class="bterm"><a href="xdproQueryAdapter_2.htm" id="HV01021320" lcid=" ">QueryAdapter</a></b> property of the <b class="bterm">DataObject</b> object, the <b class="bterm">ADOAdapter</b> data adapter object's <b class="bterm"><a href="xdproConnection.htm" id="HV01021269" lcid=" ">Connection</a></b> property is used to display the ADO connection string in a message box.</p><pre><code>function TestDataObjects()
{
   var objDataObject;
	
   // Set a reference to the specified data object.
   objDataObject = XDocument.DataObjects("CityList");
	
   // Display the connection information for the ADOAdapter object.
   XDocument.UI.Alert("Data Adapter: " + objDataObject.QueryAdapter.Connection);
	
   objDataObject = null;
}
</code></pre><p>For more information about using the <b class="bterm">DataObject</b> object, see <a href="inconAccessingExternalDataSources.htm" id="HV01039914" lcid=" ">Accessing external data sources</a>.</p><script type="text/javascript" language="JScript" src="ofvbanl.js"></script><span id="ofVBAISpan" class="ofvbaispan"><iframe id="ofVBAIFrame" frameborder="0" marginheight="0" marginwidth="4" scrolling="auto" width="100%" src="../links/xdobjDataObject_l.htm"></iframe></span><center><a href="XMLSchemaCopyright_HV01147162.htm">&copy;2003-2004 Microsoft Corporation. All rights reserved.</a>  

Permission to copy, display and distribute this document is available at: <a 

href="http://r.office.microsoft.com/r/rlidAWSContentRedir?AssetID=XT010988631033&amp;CTT=11&amp;Origin=HV011232471033" 

target="_new">http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp</a></center></body></html>