Mixed ASP & .NET app: SQL Connection Issues

Last post 06-08-2009 1:30 PM by AceCorban. 0 replies.

Sort Posts:

  • Mixed ASP & .NET app: SQL Connection Issues

    06-08-2009, 1:30 PM
    • Contributor
      5,457 point Contributor
    • AceCorban
    • Member since 08-23-2007, 11:43 AM
    • Monterey, CA
    • Posts 1,068

    Duplicate post, but I'm moving it to a "more appropriate" forum:

    We migrated a series of apps to different servers, some of which were developed before I showed up.  The developer of one in particular is out of town, so I have to fix it.  I'm getting the following error:

    "SQL Server does not exist or access denied."

    No sweat, I'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.  So I run through the standard checklist of troubleshooting, nothing fixes the issue.  Then I realize that logging into the application works (so I can connect to the SQL Server then, but not later in the app).  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.

    //connStr is pulled from web.config:
    //"provider=SQLOLEDB; server=myServer; database=myDB; uid=myUID; pwd=myPwd;"
    conn = New OleDbConnection(connStr)
    conn.Open
    //do a query
      

    That code works.  This throws an exception:

    conn = Server.CreateObject('ADODB.Connection')
    rs = Server.CreateObject('ADODB.Recordset')
    conn.open("provider=SQLOLEDB; server=myServer; database=myDB; uid=myUID; pwd=myPwd;")
    //yeah, the connStr is hardcoded...dont ask me,
    //but it DOES match the connStr in the functional piece
    
    
     

    So the connection strings match, but one works, one doesn't.  Is there something I'm missing?  Some difference between classic ASP and .NET perhaps that could cause this disparity?  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 "ADODB.Connection".  Thoughts?

     

    I never lose, some people are just better than me at winning.
Page 1 of 1 (1 items)