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

Global.asa

Status
Not open for further replies.

opo

Programmer
Jul 30, 2001
56
US
Learning how to use asp's. Want to use globa.asa to hide connections from outside world. Are you suppose to put the vbscript/javascript code that handles things on the session/application level inside the <object> tags in the
global.asa. I'm am also trying to use a .dll i wrote to process the queries to the database, but in can't see the connection string in the global.asa
 
You have to pass the .dll the Connection String information, it (the COM object) can't &quot;see&quot; anything within the ASP application. Wushutwist
 

Here's the code in my global.asa
<OBJECT RUNAT=Server SCOPE=Application ID=MyInfo PROGID=&quot;MSWC.MyInfo&quot;>


</OBJECT>
<OBJECT RUNAT=Server SCOPE=Session ID=MyInfor PROGID=&quot;MSWC.MyInfo&quot;>
Sub Session_OnStart
Session(&quot;ConnectionTimeout&quot;)= 30
Session(&quot;CommandTimeout&quot;)= 30
Session(&quot;ErrorCount&quot;)= 0
End Sub

Sub Session_OnEnd
Session(&quot;ConnectionTimeout&quot;)= &quot;&quot;
Session(&quot;CommandTimeout&quot;)= &quot;&quot;
End Sub
</Script>
</OBJECT>
<SCRIPT LANGUAGE =VBSript RUNAT=Server>
Sub Application_OnStart
Application(&quot;AllowedErrorsBeforeWarning&quot;)= 3
Application(&quot;ConnectString&quot;)= &quot;DNS=Flddata; uid=sa;pwd=mdtelecom;&quot;
End Sub
Sub Application_OnEnd
Application(&quot;ConnectString&quot;)= &quot;&quot;
End Sub
</Script>

the dll is suppose to pull the connection string from this.
 
U have to do an method or properties to your com object that receive the connection string from the global.asa file

let's say that u have an properties named connstr u only have to say what connection string to use


<OBJECT RUNAT=Server SCOPE=Session ID=MyInfor PROGID=&quot;MSWC.MyInfo&quot;>
...
MyInfor.connstr=&quot;DNS=Flddata; uid=sa;pwd=mdtelecom&quot;
...

i dont know if your method works but this work great... ________

George
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top