<?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: select data from SQL-database using like</title><link>https://www.infopathdev.com:443/forums/thread/52888.aspx</link><pubDate>Thu, 18 Mar 2010 09:13:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:52888</guid><dc:creator>tomasrudh</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/52888.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=52888</wfw:commentRss><description>&lt;p&gt;Thanks for your reply, you are quite right, some text fell away, sorry about that:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;SELECT * FROM brKlientTabel WHERE Navn LIKE &amp;#39;%hello%&amp;#39;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;The error message appears when I click the button that runs the code, that is when the query is run. If I omit the first % it works just fine.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;/Tomas&lt;/p&gt;</description></item><item><title>Re: select data from SQL-database using like</title><link>https://www.infopathdev.com:443/forums/thread/52834.aspx</link><pubDate>Wed, 17 Mar 2010 15:02:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:52834</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/52834.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=52834</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Is the error occurring when you try to query the database, or before you do the actual query?&amp;nbsp; I can&amp;#39;t think of a reason why you would get that error, but your query doesn&amp;#39;t look right.&amp;nbsp; Doesn&amp;#39;t there need to be some column in the query that you are comparing to that wildcard expression, as in:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&amp;nbsp;SELECT * FROM brKlientTabel WHERE &lt;b&gt;CoolColumn LIKE &lt;/b&gt;&amp;#39;%hello%&amp;#39;&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;</description></item><item><title>select data from SQL-database using like</title><link>https://www.infopathdev.com:443/forums/thread/52823.aspx</link><pubDate>Wed, 17 Mar 2010 12:50:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:52823</guid><dc:creator>tomasrudh</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/52823.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=52823</wfw:commentRss><description>&lt;p&gt;I have made a data connection and some custom code in Visual Basic for Applications to search for data in a SQL database:&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/font&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; myAdoQueryConnection &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; AdoQueryConnection = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Me&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.DataConnections(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;brKlientTabel2&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; myNav1 &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; XPathNavigator = CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:myFields/my:CL_OwnersShareholders&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; owners &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; = myNav1.InnerXml&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;myAdoQueryConnection.Command = &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;SELECT * FROM brKlientTabel WHERE &amp;#39;%&amp;quot; &amp;amp; owners &amp;amp; &amp;quot;%&amp;#39;&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This gives an error message: &lt;/p&gt;
&lt;p&gt;Attempted to read or write protected memory. This is often an indication that other memory is corrupt.&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;if I select using this line:&lt;/p&gt;
&lt;p&gt;myAdoQueryConnection.Command = &lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;SELECT * FROM brKlientTabel WHERE &amp;#39;&amp;quot; &amp;amp; owners &amp;amp; &amp;quot;%&amp;#39;&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;it works.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There seems to be a problem searching with a percent sign at the very start of the search string, could this be the case, or am I doing something else wrong?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Tomas Rudh&lt;/p&gt;
&lt;p&gt;Sweden&lt;/p&gt;&lt;/font&gt;</description></item></channel></rss>