returning table names

Results 1 to 2 of 2

Thread: returning table names

  1. #1
    Join Date
    Dec 1969

    Default returning table names

    hi, i&#039;m trying to create a record set out of each table in my access database, and since they will all have similar sql statements to retrive them, i want to loop through each table (name) in the database and create a record set for each (rsTablename)<BR>can anyone please tell me how to do this?<BR>i&#039;m looking for something like:<BR><BR>for each TableName in database<BR>&nbsp;&nbsp;&nbsp;sqlTableName = "SELECT * FROM TableName"<BR>&nbsp;&nbsp;&nbsp;set TableName = Server.CreateObject("ADODB.Recordset")<BR> &nbsp;&nbsp;&nbsp;TableName.ActiveConnection = strConnect<BR> &nbsp;&nbsp;&nbsp;TableName.Source = sqlAudio<BR> &nbsp;&nbsp;&nbsp;TableName.CursorType = 0<BR> &nbsp;&nbsp;&nbsp;TableName.CursorLocation = 2<BR> &nbsp;&nbsp;&nbsp;TableName.LockType = 3<BR> &nbsp;&nbsp;&nbsp;TableName.Open()<BR>next<BR><BR> any help greatly appreciated<BR>Thanks<BR>Tim..

  2. #2
    Join Date
    Dec 1969

    Default ADODB.Connection.OpenSchema

    Look in the docs for that method.<BR><BR>Basically, you call OpenSchema to get a recordset that returns various kinds of system data (yes, including table names) instead of user data. Simple as that.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts