|
-
Apr 28th, 2000, 04:45 PM
#1
Thread Starter
Addicted Member
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
-
Apr 28th, 2000, 06:02 PM
#2
Addicted Member
Hi,
Do you mean viewing the structure of the .MDB and the tables?
Please Cleaify.
-
Apr 28th, 2000, 06:41 PM
#3
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.
-
Apr 28th, 2000, 11:55 PM
#4
Thread Starter
Addicted Member
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]
-
Apr 29th, 2000, 04:18 AM
#5
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
-
Apr 29th, 2000, 05:37 PM
#6
Thread Starter
Addicted Member
Thanks I'll try later.
Keiko
-
Apr 30th, 2000, 07:32 AM
#7
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|