<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/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>Migrating from ASP to ASP.NET</title><link>http://forums.asp.net/29.aspx</link><description>Discuss moving from classic ASP to ASP.NET. </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Mixed ASP &amp; .NET app: SQL Connection Issues</title><link>http://forums.asp.net/thread/3218257.aspx</link><pubDate>Mon, 08 Jun 2009 17:30:33 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3218257</guid><dc:creator>AceCorban</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3218257.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=29&amp;PostID=3218257</wfw:commentRss><description>&lt;p&gt;&lt;a class="" href="http://forums.asp.net/t/1432769.aspx"&gt;Duplicate post&lt;/a&gt;, but I&amp;#39;m moving it to a &amp;quot;more appropriate&amp;quot; forum:&lt;/p&gt;We migrated a series of apps to different servers, some of which were developed before I showed up.&amp;nbsp; The developer of one in particular is out of town, so I have to fix it.&amp;nbsp; I&amp;#39;m getting the following error: 
&lt;p&gt;&lt;em&gt;&amp;quot;SQL Server does not exist or access denied.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;No sweat, I&amp;#39;ve seen this error a thousand times before, it is most likely a connection string issue, user login issue, remote connections, or mixed authentication mode issue.&amp;nbsp; So I run through the standard checklist of troubleshooting, nothing fixes the issue.&amp;nbsp; Then I realize that logging into the application works (so I can connect to the SQL Server then, but not later in the app).&amp;nbsp; Figuring maybe there is a connection string hardcoded somewhere in the broken piece, I come to discover that the broken piece is classic ASP, whereas the functional piece is .NET.&lt;/p&gt;&lt;pre class="coloredcode"&gt;//connStr is pulled from web.config:
//&lt;span class="st"&gt;&amp;quot;provider=SQLOLEDB; server=myServer; database=myDB; uid=myUID; pwd=myPwd;&amp;quot;&lt;/span&gt;
conn = &lt;span class="kwd"&gt;New&lt;/span&gt; OleDbConnection(connStr)
conn.Open
//do a query&lt;/pre&gt;&amp;nbsp;&amp;nbsp; 
&lt;p&gt;That code works.&amp;nbsp; This throws an exception:&lt;/p&gt;&lt;pre class="coloredcode"&gt;conn = Server.CreateObject(&lt;span class="cmt"&gt;&amp;#39;ADODB.Connection&amp;#39;)
&lt;/span&gt;rs = Server.CreateObject(&lt;span class="cmt"&gt;&amp;#39;ADODB.Recordset&amp;#39;)
&lt;/span&gt;conn.open(&lt;span class="st"&gt;&amp;quot;provider=SQLOLEDB; server=myServer; database=myDB; uid=myUID; pwd=myPwd;&amp;quot;&lt;/span&gt;)
//yeah, the connStr is hardcoded...dont ask me,
//but it DOES match the connStr in the functional piece

&lt;/pre&gt;&amp;nbsp; 
&lt;p&gt;So the connection strings match, but one works, one doesn&amp;#39;t.&amp;nbsp; Is there something I&amp;#39;m missing?&amp;nbsp; Some difference between classic ASP and .NET perhaps that could cause this disparity?&amp;nbsp; The only difference I see is .NET is using an OleDBConnection object and classic ASP is using a server created object by the name of &amp;quot;ADODB.Connection&amp;quot;.&amp;nbsp; Thoughts?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>