Howdy, Stranger!

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

Categories

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

  • faustinegeorgefaustinegeorge Member Posts: 351
    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
    :

  • Justin BibJustin Bib USAMember Posts: 0

    \ http://forcoder.org \ free video tutorials and ebooks about { Delphi PL/SQL Scratch Go C++ Visual Basic .NET Assembly Java JavaScript PHP Perl Ruby Visual Basic C# R Objective-C Python MATLAB C Swift Ada Clojure Fortran Apex COBOL D ABAP Lua Crystal Bash Hack Lisp VBScript Awk Kotlin Alice FoxPro Transact-SQL Erlang Logo Scala Julia Scheme Rust Prolog LabVIEW ML F# Dart SAS } __________

Sign In or Register to comment.