How can I get table names from a database

Hi,

I like to request the tablenames from a database on my website. It is a MS ACCESS database. How can I do it?

Roderik

Comments

  • Hi,I think the following code should do it.Give the DSN you need.

    <%
    Dim con
    set con=Server.CreateObject("ADODB.Connection")
    con.open "DSN={your dsn}"
    Dim objADOXDatabase
    Set objADOXDatabase = Server.CreateObject("ADOX.Catalog")
    objADOXDatabase.ActiveConnection = con

    'Change the name...
    for each x in objADOXDatabase.Tables
    'objADOXDatabase.Tables(oldName).Name = newName
    response.write x.Name&"<br>"
    next
    'Clean up...
    Set objADOXDatabase = Nothing


    %>

    faustine
    ---------------
    ==================

    : Hi,
    :
    : I like to request the tablenames from a database on my website. It is a MS ACCESS database. How can I do it?
    :
    : Roderik
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion