thunderain
Programmer
I have Windows 98. My two databases is set up in Control Panel, ODBC Data Sources, User DSN
My program will be using two databases. I am using a drop down menu for the user to pick which database to work with. Once the database is picked, they will be using it on all other pages. After selecting the database, I need to store the variable somewhere to access it on all other pages. I have used global.asa to store variables that are hardcoded in and that works find. Reading up on it, i don't see how to send a variable to global.asa to store it, or for that matter if you can.
Can you send a varible to global.asa to be stored and used in other pages?
If yes, how?
Should I put it in an asp include, I am going in that direction? Here is my code.
------
selectdatabase.asp
--------
<%
Dim gatekeeper, gkadmin
gatekeeper="DSN=autovu"
gkadmin="DSN=autovu2"
%>
<!-- menu to pick database -->
<form method="get" ACTION="database-var.asp">
Database:
<select name="database">
<option value=<%=gatekeeper%>>GateKeeper
<option value=<%=gkadmin%>>GKAdmin
<option selected>----Choose One------
<input type="submit" value="Submit!" >
</select>
</form>
----------
database-var.asp
----------
<%
Dim myDSN
myDSN = Request.QueryString("database"
Dim objConn, objRS
Set objConn = Server.CreateObject("ADODB.Connection"
objConn.Open myDSN
Set objRS = objConn.Execute("SELECT username FROM passwords" )
Response.write username
%>
1/ It seens to be selecting the database ok. There are no errers, but I am not getting anything from Response.write username
2/ When the database is selected, how do i store it permanently while the user goes to other pages and call it from other pages?
Thank you,
Larry
My program will be using two databases. I am using a drop down menu for the user to pick which database to work with. Once the database is picked, they will be using it on all other pages. After selecting the database, I need to store the variable somewhere to access it on all other pages. I have used global.asa to store variables that are hardcoded in and that works find. Reading up on it, i don't see how to send a variable to global.asa to store it, or for that matter if you can.
Can you send a varible to global.asa to be stored and used in other pages?
If yes, how?
Should I put it in an asp include, I am going in that direction? Here is my code.
------
selectdatabase.asp
--------
<%
Dim gatekeeper, gkadmin
gatekeeper="DSN=autovu"
gkadmin="DSN=autovu2"
%>
<!-- menu to pick database -->
<form method="get" ACTION="database-var.asp">
Database:
<select name="database">
<option value=<%=gatekeeper%>>GateKeeper
<option value=<%=gkadmin%>>GKAdmin
<option selected>----Choose One------
<input type="submit" value="Submit!" >
</select>
</form>
----------
database-var.asp
----------
<%
Dim myDSN
myDSN = Request.QueryString("database"
Dim objConn, objRS
Set objConn = Server.CreateObject("ADODB.Connection"
objConn.Open myDSN
Set objRS = objConn.Execute("SELECT username FROM passwords" )
Response.write username
%>
1/ It seens to be selecting the database ok. There are no errers, but I am not getting anything from Response.write username
2/ When the database is selected, how do i store it permanently while the user goes to other pages and call it from other pages?
Thank you,
Larry