Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 20th, 2003, 01:23 PM
Authorized User
 
Join Date: Sep 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default open a database depending on session id

Users log in to my system using their id and I have a session variable called Session("id") that stores the username.
Users have research interests, publications and courses they teach.
I want to open a specific user database depending on who logged on as user. Say, user "xyz" logged in , they I want to open "xyz" database.

How should the following asp code be modified so that name of database , in this case "xyz" chenges to "ymx" when user "ymx" logs in?

Set objConn = Server.CreateObject("ADODB.Connection")
strConnection= "Driver={Microsoft Access Driver (*.mdb)};" & _
              "Dbq=" & Server.MapPath(".") & "\xyz.mdb;"
I gues i have to concatenate the seesion id with the path . How can I do that ? please help!!





 
Old October 22nd, 2003, 01:52 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

"Dbq=" & Server.MapPath(".") & "\xyz.mdb;"
should be;
id=Session("id")
strPath= "\" & id& ".mdb;"
"Dbq=" & Server.MapPath(".") & strPath



surendran





Similar Threads
Thread Thread Starter Forum Replies Last Post
what is session id and when does it expire nidhimittal PHP How-To 3 June 29th, 2006 05:17 AM
what is session id and when does it expire nidhimittal Beginning PHP 0 June 26th, 2006 07:20 AM
session id rbojja J2EE 2 February 13th, 2006 05:48 AM
session id rbojja J2EE 1 February 11th, 2006 01:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.