Data source name not found

  • Thread starter Thread starter LordMerlin
  • Start date Start date
L

LordMerlin

I recently took over a site from someone else, written in ASP. The
global.asa file contrains the DB connection string, yet I haven't
seen this before.
When I try and load the site, it gives me an internal 500 error, and
the following:

Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Driver Manager] Data source name not found and no
default driver specified
//global.asa, line 20

This is taken from the global.asa file:



Sub Application_OnStart
Application("hellopeter") =
"DSN=hellopeter2;UID=username;PWD=password"
Application("Datasource") =
"DSN=hellopeter2;UID=username;PWD=password"
Application("question") =
"Provider=SQLOLEDB.1;Persist Security Info=False;User
ID='username';Password='password';Initial Catalog='catalogue
name';Data Source=remote host"

End Sub


I haven't seen anything like this before. Can anyone please direct to
to some answers? I haven't done any ASP.NET coding b4, so I'm not
sure if this is ASP.NET, if it is, what do I need todo to get this
site working on my PC, so I can work on it?
 
Hi LordMerlin!

The global.asa file is used in "classic" ASP web application and not ASP.NET
web applications (which use global.asax). The "Application" object is a
global object for all users. All that the original developer has done here
is to use the Application object to store various static settings - in this
case the database connection strings for each database that the web
application needs to talk to. It appears from your code snippet that 3 data
sources are being used - 2 that use DSN's and another that is talks to a SQL
Server database using the SQLOLEDB driver. From the error message you are
getting it sounds like an ADO connection attempt is being made somewhere in
the web application that is using either the Application("hellopeter") or
Application("Datasource") as the connection string. If the "hellopeter2"
DSN has not been set up on your PC then you will get an error.

I suggest you check what DSN connections are set up on your PC [Control
Panel -> Administrative Tools -> Data Sources (ODBC)]

Gary

LordMerlin said:
I recently took over a site from someone else, written in ASP. The
global.asa file contrains the DB connection string, yet I haven't
seen this before.
When I try and load the site, it gives me an internal 500 error, and
the following:

Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Driver Manager] Data source name not found and no
default driver specified
//global.asa, line 20

This is taken from the global.asa file:



Sub Application_OnStart
Application("hellopeter") =
"DSN=hellopeter2;UID=username;PWD=password"
Application("Datasource") =
"DSN=hellopeter2;UID=username;PWD=password"
Application("question") =
"Provider=SQLOLEDB.1;Persist Security Info=False;User
ID='username';Password='password';Initial Catalog='catalogue
name';Data Source=remote host"

End Sub


I haven't seen anything like this before. Can anyone please direct to
to some answers? I haven't done any ASP.NET coding b4, so I'm not
sure if this is ASP.NET, if it is, what do I need todo to get this
site working on my PC, so I can work on it?
 
Back
Top