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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Global.ASA file not being used??

Status
Not open for further replies.

TimBiesiek

Programmer
Nov 3, 2004
151
AU
Hi all!

I have an ASP application designed by an external company, which we are trying to get running on our system.

I had it running, but then installed MDAC 2.8 for another application, and this one then stopped running. When I try to start the app, it says that the 'Data Source name not found...' etc etc.

I've added some response.writes to find out the connection string, and it is using a default one (Which it shouldn't be), instead of the one specified in the Global.asa file...

Here's what is in the ASP file where the error is:

Code:
if Application("TrnPocketPCConnectString") > "" then
	Session("TRNCONNECT") = Application("TrnPocketPCConnectString")
else
	Session("TRNCONNECT") = "DSN=immtst;UID=immr4_Trn;PWD=immr4_trn"
end if

This obviously checks the connection string 'TrnPocketPCConnectString', and if it's blank, uses the DSN stated in the else clause. However, in the global.asa file is the following:

Code:
Application("TRNPocketPCConnectString") = "DSN=BIT Supp;UID=TrnUser;PWD=TrnPass"

From this, it looks to me like the global.asa file isn't being read from when the app first starts... But I am only a novice with this kind of stuff...

Can anyone offer some help or suggestions?

Thanks!!!
 
Make sure that the root folder for your web app is actully marked as an application in the IIS Admin tool... look at the "Directory" tab on the properties dialog box, the bottom half of the tab should have Application Settings... Application name, Starting point, and so on... look on the right side of the bottom half and you should see 3 buttons... if the top one of those 3 is marked "Create" then the IIS is not considering your folder to be its own separate web application.
 
Are your other session variables working? If not the problem might be that session state is not enabled.
 
Na, doesn't look like it...

How do I get the session state enabled?
 
Look for the "Configuration" button just below where you saw that "Remove" button... Clicking it brings up another tabbed dialog box... go to the middle tab and up near the top is a checkbox for session state.
 
Ah, yip.... I did see that.... it's ticked already though. Timeout set to 20 mins...
 
The variable assignment in the global.asa file .... is it inside the Application_onStart() method?

Is it possible that the application variable is being overwritten somewhere?

Does your global.asa reference the MDAC by its GUID?

 
Yip, in is in the Application_onstart sub...

I wouldn't think that it's being overwritten, as it was working fine yesterday, up until MDAC2.8 was installed, and nothing has changed in the code itself...

I've since had MDAC2.8 uninstalled, and reinstalled MDAC2.6, but with no luck.

When you say MDAC being reference by it's GUID, what would I be looking for? All I can see in the global.asa file is:

Application("IMMTrnDatabase") = ORACLE

Cheers!
 
There is another ini file that is used too, and in here it mentions another couple of DLLs:

demandload=mss6511l.dll,ora8040l.dll,syb112al,ocx4010c.dll,ufcom10c.dll, ufcomskc.dll, txt1010c.dll

Would these DLLs be the MDAC ones? Perhaps something has gone screwy with them?
 
Oh you would see a 24 digit GUID if it was in there... you can put a reference to a DLL in the global.asa file to get the public constants... in this case a GUID for MDAC would be used to avoid needing to either INCLUDE the adovbs.inc file or just use the raw integer constants for ADO properties like LockType, CursorType, etc..

Anyway....

Suppose you made a tiny ASP like this:
Code:
<%
Response.Write "My favorite database is: " & Application("IMMTrnDatabase")
%>

Thats it... nothing else.... would it work?
 
Nope, no mention of msado15.dll...

The ASP returns:

'My Favourite database is:' and nothing else....
 
Ah! Solved it!

I moved the global.asa file out of the directory into the application directory (which is obviously a sub directory of the dir)...

Probably not the best way of doing it, but it works!
 
oh my!

yes absolutely, the global.asa should be in the root folder of the application... this allows you to host multiple web applications on the same instance of IIS... each application has it's own different copy of global.asa containg relevant ASP code for each unique web app.
 
Hmmm, strange that it was working the other day without it in the application root folder!

However, all good now!

Thanks!
 
Hmmm, strange that it was working the other day without it in the application root folder!

We've had a outbreak of Gremlins of late. ;-)


General FAQ faq333-2924
5 steps to asking a question faq333-3811
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top