<?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>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Handling "Failed Connection to Datasource Error" in infopath using custom messages</title><link>https://www.infopathdev.com:443/forums/thread/41651.aspx</link><pubDate>Wed, 13 May 2009 12:20:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41651</guid><dc:creator>GazM</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41651.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=41651</wfw:commentRss><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I use the following VB code to check to see if&amp;nbsp;the Access DB is in use with a Form Load event. It checks for the existence of the lock file (.ldb) then displays a custom message if the DB is in use. I don&amp;#39;t know SQL but I&amp;#39;m sure it should have something similar.&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;Sub &lt;/font&gt;XDocument_OnLoad(eventObj)&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; db &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;/font&gt;&lt;font size="2"&gt; = (&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;pathname\access.ldb&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;font size="2"&gt;&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&amp;#39;Check to see if database is in use&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;If&lt;/font&gt;&lt;font size="2"&gt; File.Exists(db) &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Then&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;MsgBox(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;your message&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;Close()&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Else&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;Open()&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;If&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Sub&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Gary&lt;/p&gt;</description></item><item><title>Handling "Failed Connection to Datasource Error" in infopath using custom messages</title><link>https://www.infopathdev.com:443/forums/thread/41584.aspx</link><pubDate>Tue, 12 May 2009 14:23:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41584</guid><dc:creator>arunk.krish</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41584.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=41584</wfw:commentRss><description>&lt;p&gt;Can anyone help me in handing Infopath&amp;nbsp;sql exceptions before form Load.&lt;/p&gt;
&lt;p&gt;For example, if the datasource object or name is not available in data base,&amp;nbsp; before Form Load I am gettting the following error.&lt;/p&gt;
&lt;p&gt;Failed Connection to Datasource:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The query cannot be run for the following DataObject: EmployeeLookUp&lt;/p&gt;
&lt;p&gt;InfoPath cannot run the specified query.&lt;br /&gt;[0x80040E37][Microsoft OLE DB Provider for SQL Server] Invalid object name &amp;#39;dbo.vw_EmployeeLookup&amp;#39;.&lt;/p&gt;
&lt;p&gt;Instead of getting the above error message, I want to handle it by using my custom Message. &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>