<?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>SQL Database Integration</title><link>https://www.infopathdev.com:443/forums/47.aspx</link><description>For questions concerning issues in the integration of SQL and Microsoft InfoPath.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: SQL where</title><link>https://www.infopathdev.com:443/forums/thread/17004.aspx</link><pubDate>Thu, 25 Aug 2005 00:33:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17004</guid><dc:creator>Mik</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17004.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=17004</wfw:commentRss><description>Me replying to my own post again.&lt;br /&gt;It seems somethings wrong with the database end of this.&lt;br /&gt;&lt;br /&gt;The table 'ad_details' is actually a view of our Active Directory user information.&lt;br /&gt;Apparently not all of the rows/users are populating and so some queries dont work.&lt;br /&gt;I might be back with furthur queries depending on what happens.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;   Mik</description></item><item><title>Re: SQL where</title><link>https://www.infopathdev.com:443/forums/thread/17003.aspx</link><pubDate>Wed, 24 Aug 2005 02:44:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17003</guid><dc:creator>Mik</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17003.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=17003</wfw:commentRss><description>Ok I think I have the first bit worked out:&lt;br /&gt;&lt;br /&gt;'get username&lt;br /&gt;dim objWscript&lt;br /&gt;set objWscript = CreateObject("WScript.Network")&lt;br /&gt;usr = objWscript.UserName&lt;br /&gt;&lt;br /&gt;'create query&lt;br /&gt;dim objDataAdapter&lt;br /&gt;set objDataAdapter = XDocument.DataObjects("ad_details").QueryAdapter&lt;br /&gt;objDataAdapter.Command = objDataAdapter.Command + " where Windows_Logon = '" + usr + "'"&lt;br /&gt;&lt;br /&gt;'query database	&lt;br /&gt;objDataAdapter.Query()&lt;br /&gt;&lt;br /&gt;But I thought that the results would automatically populate a drop down list box so that I could run another query based on that.&lt;br /&gt;Any ideas how to transfer this off into the secondary data source, or any ideas why this isnt working?</description></item><item><title>Re: SQL where</title><link>https://www.infopathdev.com:443/forums/thread/17002.aspx</link><pubDate>Tue, 23 Aug 2005 23:33:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17002</guid><dc:creator>Mik</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17002.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=17002</wfw:commentRss><description>I didnt create it from an existing SQL table because one didnt exist (infact the functionality of it wasnt really decided at that point)&lt;br /&gt;&lt;br /&gt;I understand that it can be done programmically by specifying what data connection you want to use, then adding to its default query (as a string) where i can use a variable in the WHERE condition, then execute the connection.&lt;br /&gt;&lt;br /&gt;I have seen code to do this before, but at that point I was looking for an insert command to a secondary data source, and so i didnt bookmark it, or copy it down.&lt;br /&gt;&lt;br /&gt;I found something similar perhaps in the developers reference of infopath help..&lt;br /&gt;   var objADOAdapter;&lt;br /&gt;   objADOAdapter = XDocument.DataObjects("CityDropDownList").QueryAdapter;&lt;br /&gt;   XDocument.DataObjects("CityDropDownList").Query();&lt;br /&gt;   objADOAdapter = null;&lt;br /&gt;&lt;br /&gt;But i would need to modify the query itself&lt;br /&gt;Any ideas?</description></item><item><title>Re: SQL where</title><link>https://www.infopathdev.com:443/forums/thread/17001.aspx</link><pubDate>Tue, 23 Aug 2005 05:36:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17001</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17001.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=17001</wfw:commentRss><description>Hi Mik,&lt;br /&gt;When you created the form did you do so from a SQL connection? Was the main data source created from the database schema, or is it something you created? In general, you will have to set a query field and programmatically (via rules) call the SQL query adapter. This assumes that you use a main data source which was created from the DB. If you have your own data source, then you will have to write code to do this.&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>SQL where</title><link>https://www.infopathdev.com:443/forums/thread/16730.aspx</link><pubDate>Tue, 23 Aug 2005 04:10:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:16730</guid><dc:creator>Mik</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/16730.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=16730</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;I am developing a form which will retrieve the users information from a table based on their username. I can get their username, but how do I query the database conditionally?&lt;br /&gt;I have set it up as a secondary data source (will be submitting to another database)&lt;br /&gt;&lt;br /&gt;I understand you can add additional commands to the query in the script (currently using vbscript) but I cant find an example.&lt;br /&gt;&lt;br /&gt;Also, there is a place to add a 'where' condition in the data connection itself, but to use this, I would have to grab a fields value first to query against, which would require a script anyway..&lt;br /&gt;&lt;br /&gt;Can you help me in developing these somewhat simple where statements? I am lost.&lt;br /&gt;&lt;br /&gt;Thanks in advance,&lt;br /&gt;   Mik</description></item></channel></rss>