|
-
July 19th, 2001, 06:50 AM
#1
MSACCESS
How can i generate a list of all the tables of a MSAccess database that i am selecting through a common dialogbox?Thanks in advance.
-
July 19th, 2001, 07:06 AM
#2
Re: MSACCESS
One way of doing this is to execute SQl
sSQL = "Select Name from MSysObjects where Type = 1"
rs.OPen sSQl, adOpenDynamic, adLockOptimistic
and then you can enter this for example to a listbox
do while not rs.eof
lst.AddItem rs!Name
rs.movenext
Loop
Iouri Boutchkine
[email protected]
-
July 19th, 2001, 07:07 AM
#3
Re: MSACCESS
Using ADOX
Sub ListTables()
Dim cat As New ADOX.Catalog
Dim tbl As ADOX.Table
'References : Microsoft ADO Ext 2.1 or DDL and Security
' Open the catalog
cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\nwind.mdb;"
' Loop through the tables in the database and print their name
For Each tbl In cat.Tables
If tbl.Type <> "VIEW" Then Debug.Print tbl.Name
'not to see system tables If Left$(tbl.Name, 4) <> "MSys" Then Debug.Print tbl.Name
Next
End Sub
Iouri Boutchkine
[email protected]
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
|