Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Issue with ASP page

Status
Not open for further replies.

TimBiesiek

Programmer
Nov 3, 2004
151
AU
Hi all,

I am trying to get an ASP page working. It uses an ODBC connection, through a global.asa file, and everything looks fine here. ODBC connection has been set up on the test server. However, when I try to access the page from my local PC I get the following message:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/immpower/imm1.asp, line 31

The data source it is trying to connect to is specified in the global.asa file as:
Code:
Application("TSTConnectionString") = "DSN=BIT Test;UID=User;PWD=pswd"

Any help? Let me know if any more info is needed!

Cheers!
 
ODBC connection has been set up on the test server

Are you saying that the web server already has a DSN named BITTest?

If so we need to see the code in imm1.asp

Also it is a good idea to use ConnectionStrings instead of DSNs because it will save you a lot of headache if you ever need to move the application to another server, or even if you end up reinstalling windows on the existing server.

The following link will help you chose the correct Connection String:
 
Hi Sheco, thanks for the reply...

Yes, the web server has that DSN already set up...

As this is an app that was supplied by an external customer, I'd prefer not to have to alter things too much, as there may be other bits that require things to be set out as they are....

Imm1.asp is as below. This is the function that has the error. The user must enter "?IMM=TST" at the end of the URL to state which system they want to use (Test, Production, Training):

Code:
dim conn

'*****************************
function OpenDB()
'*****************************
dim sConnstr

' Connect strings now loaded from Application Variables		'dr 9nov04
' to Session variables.																		'dr 9nov04

'Added code for multiple database connections
	select case Session("IMM")
	  case "PRD"
		  'sConnstr = Application("PrdPocketPCConnectString")	'dr 9nov04
		  sConnstr = Session("PrdConnect")										'dr 9nov04	
	  case "TRN"
		  'sConnstr = Application("TrnPocketPCConnectString")	'dr 9nov04
		  sConnstr = Session("TrnConnect")										'dr 9nov04
	  case "TST"
		  'sConnstr = Application("TstPocketPCConnectString")	'dr 9nov04
		  sConnstr = Session("TstConnect")										'dr 9nov04	
	  case else
		  'sConnstr = Application("PocketPCConnectString")		'dr 9nov04
		  sConnstr = Session("Connect")												'dr 9nov04
	end select
	
	set conn = Server.CreateObject("ADODB.Connection")
	conn.Open(sConnstr)


'	sConnstr = Application("PocketPCConnectString")
'	set conn = server.CreateObject("ADODB.Connection")
'	conn.open(sConnstr)
	OpenDB = 0
end function

I had this set up on my local PC (Have got IIS intalled), and it all worked fine, but it was in moving it over to the Web Server where it seems to have gone haywire...

Cheers!
 
It's ok, got it sorted.... The DSN was set up as a user DSN, but when I changed it to a System DSN, it worked....

Cheers anyway!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top