File: xdobjADOAdapter.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 (31 lines) | stat: -rw-r--r-- 5,154 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
24
25
26
27
28
29
30
31
<html dir="ltr"><head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="assetid" CONTENT="HV01021238"><META NAME="lcid" CONTENT="1033"><title>ADOAdapter 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>ADOAdapter 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="xdobjADOAdapter.htm" title="ADOAdapter"><SPAN class="omblue">ADOAdapter</SPAN></A><br /></td></tr></table><p>Represents a connection to a Microsoft ActiveX Data Objects/OLEDB data source. The <b class="bterm">ADOAdapter</b> object is a type of Microsoft Office InfoPath 2003 <a href="#" class="glossary" onclick="AppendPopup(this,'xddataadapter')" onkeypress="AppendPopup(this,'xddataadapter')">data adapter</a> that contains all the information necessary for retrieving and submitting data to an external data source.</p><h2>Remarks</h2><p>For <a href="#" class="glossary" onclick="AppendPopup(this,'xdsecondarydatasource')" onkeypress="AppendPopup(this,'xdsecondarydatasource')">secondary data sources</a>, the <b class="bterm">ADOAdapter</b> object provides properties that can be used to get and set information about the data adapter's connection string, SQL command text, and timeout value. It also provides a method for creating an SQL command text fragment based on a specified XML node.</p><p>If an ADO/OLEDB data source is used as the primary data source for a form, the <b class="bterm">ADOAdapter</b> object is accessible through the <b class="bterm"><a href="xdproQueryAdapter_1.htm" id="HV01021319" lcid=" ">QueryAdapter</a></b> property of the <b class="bterm"><a href="xdobjXDocument.htm" id="HV01021254" lcid=" ">XDocument</a></b> object.</p><p><b>Note</b>  The <b class="bterm">ADOAdapter</b> object is limited to work only with Microsoft SQL Server and Microsoft Access databases.</p><h2>Using the ADOAdapter object</h2><p>The <b class="bterm">ADOAdapter</b> object is accessible through the  <b class="bterm"><a href="xdproQueryAdapter_2.htm" id="HV01021320" lcid=" ">QueryAdapter</a></b> property of the <b class="bterm"><a href="xdobjDataObject.htm" id="HV01024616" lcid=" ">DataObject</a></b> object, and <b class="bterm">DataObject</b> objects are accessible through the <b class="bterm"><a href="xdproDataObjects.htm" id="HV01021279" lcid=" ">DataObjects</a></b> property of the <b class="bterm">XDocument</b> object.</p><p>In the following example, the <b class="bterm"><a href="xdproTimeout.htm" id="HV01021342" lcid=" ">Timeout</a></b> property of the <b class="bterm">ADOAdapter</b> object is used to set the timeout for a particular query operation, returning the timeout to its original value after the query operation is complete:</p><pre><code>function RunLongQuery()
{

   var objADOAdapter;
   var intTimeout;
	
   // Set a reference to the ADOAdapter object.
   objADOAdapter = XDocument.DataObjects("CityDropDownList").QueryAdapter;

   // Save the original timeout value.
   intTimeout = objADOAdapter.Timeout;

   // Set a longer timeout value and then run the query.
   objADOAdapter.Timeout = 60;
   XDocument.DataObjects("CityDropDownList").Query();

   // Restore the original timeout value.
   objADOAdapter.Timeout = intTimeout;
	
   objADOAdapter = null;
   intTimeout = null;
}
</code></pre><p>For more information about using the <b class="bterm">ADOAdapter</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/xdobjADOAdapter_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>