Selecting a table name ... quite hard !!!
This one's quite hard :
- I have one database with a table named "exhibitions" that holds different fields including one called "TITLE".
- Then, in the same database, I have different tables that got their name from the "TITLE" field in the exhibitions table.
Example :
The exhibitions table is like this :
|--ID--|-------Title-------|----Artist----|
01 My house John
02 The sun Mary
03 A bottle David
So in the same Database I have a table named "exhibitions" and then other tables named "My house", "The sun", "A bottle", etc.
I have to insert records in the other tables.
I need to tell my sql to get the "title field" from the exhibitions table and then open the corresponding table.
Any ideas ?!
This is the piece of script I'm working on :
-------------- CONNECT TO DB ----------------------------------
Set Conn=Server.CreateObject("ADODB.Connection")
strConn="driver={Microsoft Access Driver (*.mdb)}; "
strConn=strConn & " DBQ=" & Server.MapPath("exhibitions.mdb")
strConn=strConn & ";pwd=" & strCode
Conn.Open strConn
-------------- SELECT THE TITLE I NEED ------------------------
tab = "select title from exhibitions where id = myId"
------------ THEN ?!?!?!?!?!?!?!?
sql = "select * from TAB" ?!?!?!?
HOPE YOU CAN HELP ME !!!!!
Thanks
Ske
|