Finding tablenames with ASP

Results 1 to 2 of 2

Thread: Finding tablenames with ASP

  1. #1
    Join Date
    Dec 1969

    Default Finding tablenames with ASP

    I&#039ve got a ACCESS database with ODBC-name: <BR>Database (how original..)<BR><BR>In this database are 3 tables:<BR>Friends_tbl<BR>Family_tbl<BR>Pets_tbl<B R><BR>Is there a way I can search through the database, and get the 3 names of the tables back? So no search within a table, but a search in the database alone.. What is the execution-command?<BR><BR>If anyone knows the answer to this one... PLEASE!

  2. #2
    Hack'n'Slash Guest

    Default RE: Finding tablenames with ASP

    I don&#039t think you can do this with VBScript.<BR><BR>In Visual Basic, Microsoft says that you can do this:<BR><BR>Public Sub OpenSchemaX()<BR> Dim cnn1 As ADODB.Connection<BR> Dim rstSchema As ADODB.Recordset<BR> Dim strCnn As String <BR> Set cnn1 = New ADODB.Connection<BR> strCnn = "Provider=sqloledb;" & _<BR> "Data Source=srv;Initial Catalog=pubs;User Id=sa;Password=; "<BR> cnn1.Open strCnn<BR> Set rstSchema = cnn1.OpenSchema(adSchemaTables) <BR> Do Until rstSchema.EOF<BR> Debug.Print "Table name: " & _<BR> rstSchema!TABLE_NAME & vbCr & _<BR> "Table type: " & rstSchema!TABLE_TYPE & vbCr rstSchema.MoveNext<BR> Loop <BR>rstSchema.Close <BR>cnn1.Close <BR>End Sub

Posting Permissions

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