Results 1 to 7 of 7

Thread: Professional help is really needed

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Posts
    229

    Hi everybody ....

    Is there any simple way (or a component in VB 6.0) to
    browse the contain of microsoft access database
    (tables and fields inside the tables) ?

    Let's say I have:

    test.mdb
    table1
    name text(20)
    address text(20)
    table2
    mark number(3)
    grade number(3)

    When I select test.mdb, I would like to get the information
    of table1 and table2 with all the fields inside.

    Anyone can help me ? Any idea is appreciated.

    Thanks
    Keiko

  2. #2
    Addicted Member
    Join Date
    Jul 1999
    Location
    Portland, OR.
    Posts
    226

    Question

    Hi,

    Do you mean viewing the structure of the .MDB and the tables?

    Please Cleaify.

  3. #3
    Guest

    Thumbs up

    it depends, are you using ADO or DAO?

    DAO:
    have a look on tabledef in your help file

    ADO:
    have look on ADOX-library in help

    best regards

    Sascha

    PS: if you need more info, contact me.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Posts
    229

    Unhappy

    Lyla,
    Yes viewing the structure of the .MDB file and tables.
    (like in MS-SQL using sp_help)

    Sascha,
    Using ADO.

    Any sample of codes ?

    Thank you
    Keiko ^_^

    [Edited by Keiko on 04-29-2000 at 01:01 PM]

  5. #5
    Guest

    Smile

    keiko,

    here is a short example, that reads all field-names,
    data-types+sizes and default values from all tables
    of an Access-database:

    good luck

    sascha

    '****************************************************

    Dim x As New ADOX.Catalog
    Dim t As New ADOX.Table
    Dim c As New ADOX.Column

    ' Be sure to create your own Connection-object
    Set x.ActiveConnection = GetConnection()

    For Each t in x.Tables
    Debug.Print t.Name
    For Each c In t.Columns
    Debug.Print c.Name & ", " & _
    c.Type & ", " & _
    c.DefinedSize & ", " & _
    c.Properties("Default")
    Next
    Next

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Posts
    229

    Smile


    Thanks I'll try later.

    Keiko

  7. #7
    Guest
    i forgot to mention that you have to reference the ADOX-library (Microsoft ADO Ext. 2.1 for DDL and Security) within your project. you need at least VB6 + SP3.

    regards

Posting Permissions

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



Click Here to Expand Forum to Full Width