<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Data Connections</title><link>https://www.infopathdev.com:443/forums/44.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Searching within a Data Connection</title><link>https://www.infopathdev.com:443/forums/thread/27911.aspx</link><pubDate>Sat, 12 Apr 2008 14:06:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:27911</guid><dc:creator>Clay Fox</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/27911.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=44&amp;PostID=27911</wfw:commentRss><description>&lt;p&gt;I believe you can use a static query with SharePoint but often a dynamic query is what you are looking for.&lt;/p&gt;
&lt;p&gt;I use web services on SQL to be able to dynamicly query anything I want and sort without needing code.&amp;nbsp; I do not think there is a way to really have dynamic queries with SharePoint, that is one of the limitations, besides no relational data capability and performance issues for scalability.&lt;/p&gt;
&lt;p&gt;There may be some code for this out there somewhere,&amp;nbsp;&amp;nbsp;I know you can load all of the data in and then&amp;nbsp;transfer it into a node in your main schema and sort and filter it there to prep it for your dropdown but that is a pan but one option.&lt;/p&gt;</description></item><item><title>Searching within a Data Connection</title><link>https://www.infopathdev.com:443/forums/thread/27909.aspx</link><pubDate>Sat, 12 Apr 2008 12:09:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:27909</guid><dc:creator>Cutejon</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/27909.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=44&amp;PostID=27909</wfw:commentRss><description>&lt;p&gt;Hi everyone,&lt;/p&gt;
&lt;p&gt;my scenario is this&amp;nbsp;:&lt;/p&gt;
&lt;p&gt;1. data connection connects to a sharepoint list / document library.&lt;/p&gt;
&lt;p&gt;2. The results returned by the data connection must further be examined so that&amp;nbsp;a subset of data will&amp;nbsp;only be taken, which is based on conditions/parameters set by user.&lt;/p&gt;
&lt;p&gt;3. Code done in VBscript.&lt;/p&gt;
&lt;p&gt;is it possible to query&amp;nbsp;the mentioned&amp;nbsp;data connection?&lt;/p&gt;
&lt;p&gt;As I have seen in some posts, this can be done via &lt;strong&gt;ADOQueryConnection,&lt;/strong&gt; which is only applicable to data connections using SQL database. Just plug in the SQL statement then viola, results are returned. (as stated in this help file: ms-help://MS.VSTACC.v80/MS.IPVSTA12.12.1033/IPVSTA12/html/4b06c377-52fc-ffeb-7b15-d5fb0e286da5.htm)&lt;/p&gt;
&lt;p&gt;&amp;#39;----------------------------Code in help file&amp;nbsp;----------------------------------------------------&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;#39; Get the Employees connection from the &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;#39; DataConnections collection.&lt;br /&gt;&amp;nbsp;&amp;nbsp; Dim myAdoQueryConnection As AdoQueryConnection =&amp;nbsp;DirectCast(Me.DataConnections(&amp;quot;Employees&amp;quot;), AdoQueryConnection)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;#39; Get the employee&amp;#39;s ID from the EmpID field in &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;#39; the main data source.&lt;br /&gt;&amp;nbsp;&amp;nbsp; Dim myNav As XPathNavigator =&amp;nbsp;CreateNavigator().SelectSingleNode(&amp;quot;/my:myFields/my:EmpID&amp;quot;,&amp;nbsp;NamespaceManager)&lt;br /&gt;&amp;nbsp;&amp;nbsp; Dim employeeID As String = myNav.InnerXml&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;#39; Change the SQL command for Employees connection to retrieve &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;#39; the record of the Employee&amp;#39;s ID entered by the user.&lt;br /&gt;&amp;nbsp;&amp;nbsp; myAdoQueryConnection.Command =&amp;nbsp;&amp;quot;select * from [Employees] where [EmployeeID] = &amp;quot; + employeeID&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;#39; Execute the updated command against the data connection to &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;#39; refresh the data.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; myAdoQueryConnection.Execute()&lt;br /&gt;&amp;#39;----------------------------End of Code-------------------------------------------------------------------&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;But my backend data store is sharepoint. What code / class do i need to use to do this? &lt;/p&gt;
&lt;p&gt;If yes, can you also have these results sorted the way you wanted? (coz this will speed up my data manipulation)&lt;/p&gt;
&lt;p&gt;If you have/can share these codes its much appreciated!&lt;/p&gt;
&lt;p&gt;Jon&lt;/p&gt;</description></item></channel></rss>