SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 20th, 2002, 04:58 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
DSN, Storing variable permanently

Originally posted by : thunderain (lbrennan1@sympatico.ca)I have Windows 98. My two databases is set up in Control Panel, ODBC Data Sources, User DSNMy 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-------- Database: GateKeeper GKAdmin ----Choose One------ ! ----------database-var.asp----------1/ It seens to be selecting the database ok. There are no errers, but I am not getting anything from Response.write username2/ 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

Reply With Quote
  #2  
Old January 22nd, 2002, 02:28 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Originally posted by : thanks JoeIt works great, problem solved!!!------------Joe at 1/22/2002 11:14:40 AMIn response to your 2 primary questions at the bottom:1) You are not seeing any value in your response statement because your code thinks the word username is a variable (which has not been assigned a value)To get the username as returned from your select statement, use this syntax:Response.write objRS("username")Your objRS object contains the results of your query - you must address your object to get the username value. 2) To store the selected DSN for use on other pages, I suggest using a cookie. Insert this code for the cookie in your database-var.asp file:'** Create new cookieresponse.cookies("db").Path = "/"response.cookies("db")("dsn") = trim(request.form("database"))To call the database DSN value on your other pages, simply refer to your cookie valueSN = request.cookies("db")("dsn")Hope this helps------------thunderain at 1/20/2002 2:58:14 AMI have Windows 98. My two databases is set up in Control Panel, ODBC Data Sources, User DSNMy 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-------- ******** Database: GateKeeper GKAdmin ----Choose One------ ! ----------database-var.asp----------1/ It seens to be selecting the database ok. There are no errers, but I am not getting anything from Response.write username2/ 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

Reply With Quote
  #3  
Old January 22nd, 2002, 01:14 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Originally posted by : Joe (joeridenour@yahoo.com)In response to your 2 primary questions at the bottom:1) You are not seeing any value in your response statement because your code thinks the word username is a variable (which has not been assigned a value)To get the username as returned from your select statement, use this syntax:Response.write objRS("username")Your objRS object contains the results of your query - you must address your object to get the username value. 2) To store the selected DSN for use on other pages, I suggest using a cookie. Insert this code for the cookie in your database-var.asp file:'** Create new cookieresponse.cookies("db").Path = "/"response.cookies("db")("dsn") = trim(request.form("database"))To call the database DSN value on your other pages, simply refer to your cookie valueSN = request.cookies("db")("dsn")Hope this helps------------thunderain at 1/20/2002 2:58:14 AMI have Windows 98. My two databases is set up in Control Panel, ODBC Data Sources, User DSNMy 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-------- ******** Database: GateKeeper GKAdmin ----Choose One------ ! ----------database-var.asp----------1/ It seens to be selecting the database ok. There are no errers, but I am not getting anything from Response.write username2/ 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

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > DSN, Storing variable permanently


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT