Changing Database with variables...

This is a discussion on "Changing Database with variables..." within the Classic ASP section. This forum, and the thread "Changing Database with variables... are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jan 1st, 2005, 20:37
Reputable Member
Join Date: Sep 2004
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Changing Database with variables...

Hello there. I have run into a bit of a problem and don't know how to fix it. here's the code:
Code: Select all
Set connectionToDatabase=Server.CreateObject("ADODB.Connection")
connectionToDatabase.ConnectionTimeout=60
connectionToDatabase.Open "DSN=Mydatabase"

Set recordSet =Server.CreateObject("ADODB.Recordset")
recordSet.Open "SELECT * FROM demoB" ,connectionToDatabase, 1,2
What I want to do, is to make demoB a variable so that I can see who has logged on and go to the appropriate table for that user. If anyone can help me It'd be much appreciated.

  #2 (permalink)  
Old Jan 1st, 2005, 22:07
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
Code: Select all
Dim userTable
userTable = "demoB"
recordSet.Open "SELECT * FROM " & userTable ,connectionToDatabase, 1,2
  #3 (permalink)  
Old Jan 3rd, 2005, 04:21
Reputable Member
Join Date: Sep 2004
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Thank you very much D3mon. I tried everything I could think of and all I needed was a space after the "&" sign. haha. Very much appreciated.
Closed Thread

Tags
changing, database, variables

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
question on Variables saltedm8 PHP Forum 12 Oct 12th, 2007 00:16
XML Code for transfering data from one SQL Server Database to another database plolla Other Programming Languages 1 Aug 3rd, 2006 18:37
Variables!! bionics PHP Forum 6 Apr 25th, 2006 15:39
Get URL and use variables JamieH PHP Forum 2 Jan 1st, 2006 03:13
Session Variables.... courtjester Classic ASP 11 Jul 6th, 2004 00:04


All times are GMT. The time now is 20:52.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43