Solved

Problems with a root global.asa and iis 7.5

Posted on 2011-02-28
9
3,643 Views
Last Modified: 2012-05-11
We are upgrading our hardware and OS.  Going from Windows 2003 Enterprise w/ iis 6 to WIndows 2008 R2 w/iis7.5.

The following code is my working global.asa code and the page code that utilizes it.

Global.asa:


Sub Application_OnStart
      Set vrmgr = Server.CreateObject("ADODB.Connection")
      vrmgr.ConnectionString = "DRIVER={SQL Server};SERVER=x.x.x.x;database=clientDB;UID=usename;PWD=password"
      vrmgr.Open
      Set Application("vrmgr") = vrmgr
End Sub

default.asp:

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.open Application("vrmgr")

I get 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


What doesn't make sense to me is that this code is used through out the site.  It only seems to fail on my initial default.asp page.  My concern is that I have over 100 sites to migrate.  The majority of them have this type of setup.

Any help would be very much appreciated.
0
Comment
Question by:vrmgr
  • 5
  • 3
9 Comments
 
LVL 28

Expert Comment

by:sammySeltzer
ID: 35001904
I think that the issue you are having is because you upgraded from 32bit server to 64bit server.

So, there are 2 versions of ODBC to worry about on 64-bit machines: the 32-bit version and the 64-bit version. So you have to Add or make changes in 2 places to cover both types.

Click Start - Admin Tools - Data Sources gets you to the 64-bit version;
 Start - Run -C:\Windows\SysWOW64\odbcad32.exe gets you to the 32-bit version.
Do all your adds/deletes/changes in both.

So basically, enable 32bit option to get your stuff to work.

Good luck
0
 
LVL 1

Author Comment

by:vrmgr
ID: 35009093
Thanks for your reply sammySeltzer.  We've never used DSN sources that were setup before.  Is that what you are referring to?

We are using DSN-less connections.  Nothing I've tried - enabling the 32bit applications - changing the AppPool Identity user and doubles checking that they do have read access to the path.

Any other thoughts?


0
 
LVL 28

Expert Comment

by:sammySeltzer
ID: 35011033
No, I wasn't referring to setting up dsn but try this. This is dsn-less connection:


Set conn = Server.CreateObject("ADODB.Connection")
    conn.Open "Driver={SQL Server};" & _
            "Server=serverName;" & _
            "Address=serverName,1433;" & _
            "Network=DBMSSOCN;" & _
            "Database=DBName;" & _
            "Uid=userid;" & _
            "Pwd=password"        

Please show error message if you run into one using this.

This is what we use for our windows 2008 R2 with sql server 2008
0
 
LVL 1

Author Comment

by:vrmgr
ID: 35018035
That still only works when i do it in the default.asp page itself.  When I read it from the the global.asa it still gives me the same error.

I'm convinced that there is a setting that I am missing in iis7.

Anything else?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 28

Expert Comment

by:sammySeltzer
ID: 35018779
>>That still only works when i do it in the default.asp page itself.

I thought that was where it was failing?

Let me look deeper and see what I can come up with.
0
 
LVL 1

Author Comment

by:vrmgr
ID: 35020166
No - it's failing when setting it in the global.asa file as an application variable and then trying to access it in the default and subsequent pages.
0
 
LVL 1

Accepted Solution

by:
vrmgr earned 0 total points
ID: 35723716
Apparnetly IIS7.5 simply doesn't accept the same syntax that iis6 did.  I have to make slight variations to the code and it works just fine.  It's unfortunately because I have a lot of sites to migrate.

Thank you all for your help.
0
 
LVL 1

Author Closing Comment

by:vrmgr
ID: 35759478
I never found a resolution other than rewriting the code.
0
 

Expert Comment

by:gudipatisv
ID: 36819050
I have a question in this regards, our is DNS less and the connection string is appropriate in global.asa file.But, we still get error message.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ASP Button to clear text 4 44
Adware on IIS hosted asp.net website 1 17
CDO.Message not able to send attachement 5 14
Recordset containing single quotes 8 23
Debug Tools to analyse IIS process: This article focus on taking memory dumps from IIS to determine which code is taking more time and to analyse which calls hangs/causes more CPU usage. To take dumps,download the following. Install1: To st…
Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now