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!

Problems Making a global variable...

Status
Not open for further replies.

GDX

Programmer
Jun 4, 2000
186
0
0
US
In global.asa i put the following in Session_Onstart....


Sub Session_OnStart
Datasource ="Dsn=main;UID=vsuser;PWD=cat5500"
End Sub

And within the ASP Page i do <% Response.write (datasource) %> but nothing comes up

I know I am doing something thats seriously wrong but I have no clue. Can someone guide me?

Happy Holidays! Gordon R. Durgha
gd@vslink.net
 
umm, i think you have to access it via the session collection... maybe something like Session.Contents('datasource'); adam@aauser.com
 
Hi,
in session_Onstart use
session(&quot;Datasource&quot;) and try to access session(&quot;datasourse&quot;) from you page and you can access.

If you just use Datasourse, it will like a local variable
 
modify your code as follows

In global.asa

Sub Session_OnStart
session(&quot;Datasource&quot;) =&quot;Dsn=main;UID=vsuser;PWD=cat5500&quot;
End Sub

And within the ASP Page
<% Response.write (session(&quot;datasource&quot;)) %>
M.Krishna Reddy
VisualSoft Technologies Ltd.
Hyderabad, India -500 016

e-mail : mckreddy@dev.vsofti.stph.net

url :
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top