0

I have old code written by someone else that recently broke during a server upgrade.

I have created a 32-bit DSN connections and a 64 bit DSN connections.

The error for the 32 bit is below.

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application

/path/to/connection/file.asp, line 12 

The code with the above error is:

<%
dim Conn
Dim powerConn
dim connstr
Dim pconnstr
connstr = Application("databaseA")
pconnstr = Application("databaseB")
Sub openConnection()
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.ConnectionTimeout = 600
    Conn.CommandTimeout = 600
    Conn.Open connstr // Error occurs here
    Set pConn = Server.CreateObject("ADODB.Connection")
    pConn.Open pconnstr
End Su

Sub closeConnection()
    Conn.close
    set Conn = Nothing
    pConn.Close
    set pConn = Nothing
End Sub
%>

I then tried the 64 bit connections and got this error:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

/path/to/connection/file.asp, line 12 

The code with the above error is:

<%
dim Conn
Dim powerConn
dim connstr
Dim pconnstr
connstr = Application("databaseA_64bit")
pconnstr = Application("databaseB_64bit")
Sub openConnection()
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.ConnectionTimeout = 600
    Conn.CommandTimeout = 600
    Conn.Open connstr // Error occurs here
    Set pConn = Server.CreateObject("ADODB.Connection")
    pConn.Open pconnstr
End Su

Sub closeConnection()
    Conn.close
    set Conn = Nothing
    pConn.Close
    set pConn = Nothing
End Sub
%>

I need help fixing this so any comments are greatly appreciated.

4
  • Please show the connection string in question for Application("databaseA_64bit") - you can xxx out the credentials/server names.
    – mjw
    Jul 2, 2018 at 18:03
  • Where is a connection string when it's a DSN setup? I don't understand classic asp as it's not .NET where there is a web.config.
    – cdub
    Jul 2, 2018 at 18:06
  • 2
    Well, you have it set in the Application variable so it may be in your global.asa? The DSN configurations are most commonly in Control Panel > Admin Tools > Data Sources > User/Local/System DSN
    – mjw
    Jul 2, 2018 at 18:10
  • It was in the gloabal file. Thanks!
    – cdub
    Jul 2, 2018 at 18:27

1 Answer 1

1

Application variables are typically assigned in the global.asa for classic ASP applications. Since your connection string appears to be assigned from Application("databaseA_64bit") you should take a look there to find your connection string.

The DSN configurations are most commonly in Control Panel > Admin Tools > Data Sources > User/Local/System DSN.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.