<?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>InfoPath Code FormEvents_Loading when written then I get an Error on web based browser form</title><link>https://www.infopathdev.com:443/forums/thread/71422.aspx</link><pubDate>Wed, 26 Oct 2011 16:11:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71422</guid><dc:creator>nabeelfaruqui</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71422.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=71422</wfw:commentRss><description>&lt;p&gt;Dear All,&lt;/p&gt;&lt;p&gt;Everything was working perfect until i embedded &lt;font size="2"&gt;FormEvents_Loading event in the code. I have data sources which get something from SQL and are using windows authentication. As soon as i add this &lt;font size="2"&gt;FormEvents_Loading code and publish my form on the server, the datasources with windows authentication are not executing and giving this error&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;span&gt;The following query failed: Country (User: , Form Name: RegNewTestForm, IP: , Connection Target: &lt;a href="http://portal:1117/Data"&gt;http://portal:1117/Data&lt;/a&gt; Connection Library/Country.udcx, Request: , Form ID: urn:schemas-microsoft-com:office:infopath:RegNewTestForm:-myXSD-2011-09-15T14-56-49 Type: DataAdapterException, Exception Message: The database adapter cannot be run because you have no credentials specified.)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Please note that all the connections which are using SA Admin password are working fine. This is the case only with windows authentication datasources. once you comment FormEvents_Loading, everything starts working fine.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;UDCX which is not working has this connection string&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;font color="#a31515" size="2" face="Consolas"&gt;&lt;font color="#a31515" size="2" face="Consolas"&gt;&lt;font color="#a31515" size="2" face="Consolas"&gt;&amp;lt;udc:ConnectionString&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=ISQ;Data Source=portal;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=NABEEL;Use Encryption for Data=False;Tag with column collation when possible=False&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2" face="Consolas"&gt;&lt;font color="#a31515" size="2" face="Consolas"&gt;&lt;font color="#a31515" size="2" face="Consolas"&gt;udc:ConnectionString&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;p&gt;&lt;font color="#0000ff" face="Consolas"&gt;&lt;/font&gt;&amp;nbsp;&lt;p&gt;&lt;font color="#0000ff" face="Consolas"&gt;UDCX which is working has this connection string&lt;/font&gt;&lt;/p&gt;&lt;font color="#0000ff" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;p&gt;&amp;lt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;p&gt;&lt;font color="#a31515" size="2" face="Consolas"&gt;&lt;font color="#a31515" size="2" face="Consolas"&gt;&lt;font color="#a31515" size="2" face="Consolas"&gt;udc:ConnectionString&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;Provider=SQLOLEDB.1;Password=testing123;Persist Security Info=True;User ID=sa;Initial Catalog=ISQ;Data Source=Portal;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=MBS-07;Use Encryption for Data=False;Tag with column collation when possible=False&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2" face="Consolas"&gt;&lt;font color="#a31515" size="2" face="Consolas"&gt;&lt;font color="#a31515" size="2" face="Consolas"&gt;udc:ConnectionString&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&amp;nbsp;Pleaes help&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;</description></item></channel></rss>