<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Communicating with SQL Server from InfoPath</title><link>https://www.infopathdev.com:443/forums/thread/65930.aspx</link><pubDate>Thu, 14 Apr 2011 13:32:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65930</guid><dc:creator>wmholt</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65930.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=65930</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Skarn,&lt;/p&gt;&lt;p&gt;Thanks a lot for the detailed reply.&amp;nbsp; I believe I have it working now based on Part 1.&amp;nbsp; I&amp;#39;m using this inside of SharePoint, so I&amp;#39;m grabbing the CustomerID as part of the Query String to the page that displays the form, using the SharePoint Query String filter web part.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Thanks again!&lt;/p&gt;&lt;p&gt;William &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Communicating with SQL Server from InfoPath</title><link>https://www.infopathdev.com:443/forums/thread/65918.aspx</link><pubDate>Thu, 14 Apr 2011 10:36:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65918</guid><dc:creator>Skarn</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65918.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=65918</wfw:commentRss><description>&lt;p&gt;You would need to understand SQL Views and basic SQL syntax to implement the below suggestion.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;PART 1 - be able to query the SQL table with &amp;#39;parameters&amp;#39; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;You can &amp;#39;emulate&amp;#39; a web-service type effect with a secondary data connection to your SQL database.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Create a &amp;#39;receive data&amp;#39; secondary data connection to your &amp;#39;Client Info&amp;#39; table (which I assume has their logonId as a field/unique key)&lt;/li&gt;&lt;li&gt;Use a filter on the logonid field and put a sample logonid value in it&lt;br /&gt;&lt;/li&gt;&lt;li&gt;have a look at the &amp;#39;SQL&amp;#39; that Infopath uses for that data connection (you can see it by pressing &amp;#39;Edit SQL&amp;#39; in the data connection wizard in IP2003&lt;br /&gt;You will see somewhere in that &amp;#39;SQL&amp;#39; the clause for filtering the data by the logonId you entered.&lt;/li&gt;&lt;li&gt;Manually replace it with a &amp;#39;placeholder&amp;#39; like &amp;lt;inputLogonId&amp;gt;&lt;/li&gt;&lt;li&gt;Save the data connection&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Now the &amp;#39;QueryString&amp;#39; value of the dataconnection will hold the &amp;#39;SQL&amp;#39; you saw earlier - you can use JScript or VBScript behind the form to alter this value (replace the &amp;lt;inputLogonId&amp;gt; with the value of the logged on user.) and query the secondary data-connection.&lt;/p&gt;&lt;p&gt;&amp;nbsp;This *might* roughly match how you&amp;#39;ve done it already - where the user inputs their userId and their details are returned back. &lt;/p&gt;&lt;p&gt;PART 2 - Send the logonId and retrieve data on form open. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;The &amp;#39;tricky&amp;#39; part might be how you determine the logonId of the user of the form. I&amp;#39;ve used a couple of methods:&lt;/p&gt;&lt;p&gt;1. Use JScript/VBScript and retrieve the users UserName environment variable, or NetworkObject&amp;#39;s user properties.&lt;/p&gt;&lt;p&gt;2. Use SQL Server to &amp;#39;identify&amp;#39; the user.&lt;br /&gt;If your SQL server uses Windows Authentication for its connections then the user sends their logonId to the SQL server whenever a query is run. &lt;/p&gt;&lt;ul&gt;&lt;li&gt;Set up a &amp;#39;View&amp;#39; on the server which purely holds a single field value - the &amp;#39;USER&amp;#39; function in SQL. &lt;br /&gt;Not exactly sure on the SQL but it might be as simple as just &amp;quot;SELECT USER&amp;quot; as the View definition. &lt;br /&gt;&lt;/li&gt;&lt;li&gt;Set up a secondary data connection in Infopath to this View&lt;/li&gt;&lt;li&gt;Query it immediately the user opens the forms (Open rules) and the returned value will be their LogonId !&lt;/li&gt;&lt;li&gt;Query the UserInfo secondary data connection from Part 1 with the returned value&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Hope this gives you some more ideas - I came up with these methods because I had no scope in my business role to create Web-Services or other methodologies.&lt;br /&gt;</description></item><item><title>Re: Communicating with SQL Server from InfoPath</title><link>https://www.infopathdev.com:443/forums/thread/65872.aspx</link><pubDate>Tue, 12 Apr 2011 10:39:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65872</guid><dc:creator>wmholt</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65872.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=65872</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Thank you again, Patrick.&amp;nbsp; When you say, &amp;quot;pass a field to the query&amp;quot;, do you mean to have the query field version of the CustomerID field placed on the form?&amp;nbsp; Then that will be sent through the web service data connection to the stored procedure?&lt;/p&gt;&lt;p&gt;I understand the web service and the stored procedure, I&amp;#39;m just not sure about the InfoPath technique of passing a field to the query.&lt;/p&gt;&lt;p&gt;Thanks!&lt;/p&gt;&lt;p&gt;William &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Communicating with SQL Server from InfoPath</title><link>https://www.infopathdev.com:443/forums/thread/65858.aspx</link><pubDate>Mon, 11 Apr 2011 17:46:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65858</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65858.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=65858</wfw:commentRss><description>&lt;p&gt;Hi William,&lt;/p&gt;
&lt;p&gt;If you parameterize the query you would pass a field to the query data connection (receive data connection) and the web service would query SQL using a sproc or dynamic sql (parameterized ADO). DBXL uses the latter since it is generic it can&amp;#39;t rely on sprocs for every form template.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;</description></item><item><title>Re: Communicating with SQL Server from InfoPath</title><link>https://www.infopathdev.com:443/forums/thread/65856.aspx</link><pubDate>Mon, 11 Apr 2011 15:31:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65856</guid><dc:creator>wmholt</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65856.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=65856</wfw:commentRss><description>&lt;p&gt;Hi Patrick, &lt;/p&gt;&lt;p&gt;That makes a lot of sense.&amp;nbsp; So, if I use the Web Service connection, I can use a parameterized query, and I would be passing the parameter to a SQL stored procedure to complete my query?&lt;/p&gt;&lt;p&gt;I&amp;#39;ll also take a look at DBXL.&lt;/p&gt;&lt;p&gt;Thanks for the help!&lt;/p&gt;&lt;p&gt;William &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Communicating with SQL Server from InfoPath</title><link>https://www.infopathdev.com:443/forums/thread/65855.aspx</link><pubDate>Mon, 11 Apr 2011 14:15:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65855</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65855.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=65855</wfw:commentRss><description>&lt;p&gt;Hi WH,&lt;/p&gt;
&lt;p&gt;Parameterized SQL queries require a Web Service or form code. Passing to a SQL&amp;nbsp;end-point doesn&amp;#39;t work so well. You can try to make those endpoints Web methods, but there are problems because MS didn&amp;#39;t really implement them well. &lt;/p&gt;
&lt;p&gt;If you need a web service, Qdabra provides a free trial DBXL (Database Accelerator) that will allow parameterized queries of SQL. You should take a look at that since it will be the fastest and lowest cost solution. If you can&amp;#39;t use third party solutions, I&amp;#39;d try to create a SQL receive data connection that pulls all of the info into the form. The issue with out-of-box SQL data connections is the fact that they don&amp;#39;t filter the data before querying the server, so if you have a ton of data (logins) you will have to pull it all down to the client and then filter. A Web service will allow you to filter on a server that has a fast connection to your SQL DB. &lt;/p&gt;
&lt;p&gt;Hope this makes some scintilla of sense. If not, I apologize.&lt;/p&gt;</description></item><item><title>Communicating with SQL Server from InfoPath</title><link>https://www.infopathdev.com:443/forums/thread/65851.aspx</link><pubDate>Mon, 11 Apr 2011 10:26:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65851</guid><dc:creator>wmholt</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65851.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=65851</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;I have a client information form, and I have had the client  able to enter his/her ID and then pull up their profile information from SQL Server 2008.  &lt;/p&gt;&lt;p&gt;I am now being asked to pull up the same information by passing the Client&amp;#39;s LoginID, which will be the same as the ClientID and somehow passing that to SQL Server and retrieving the client data.&amp;nbsp; This way the client data is filled out on the form when the client opens the form. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;I&amp;#39;m not clear on the part where I&amp;#39;m passing the ClientID to SQL Server - would this be somehow passed by InfoPath to a stored procedure in SQL Server?&amp;nbsp; What would be the mechanism to do that?&amp;nbsp; Sorry, but I&amp;#39;m new to InfoPath 2010.&amp;nbsp; I&amp;#39;ve read about the QueryString Filter web part, but I don&amp;#39;t see how passing it to the form gets the ClientID sent to SQL Server.&amp;nbsp; I think I&amp;#39;m missing a piece of the puzzle.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Thanks,&lt;/p&gt;&lt;p&gt;William H. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>