I`m doing a project in VB to conduct a Quiz competition.
I`ve succeeded in creating databases & tables using ADOX.
The problem is how can I retrieve all table names from a database using ADOX?


with regards
Robins Antony.

Never heard of ADODX.. how do you use it? and What are their diferrence?

hi frnd,
ADOX means Active Data Object extension.To create a databse using ADOX,
Required references : Microsoft Activex Data Objects 2.1 Library and Microsoft ADOExt 2.1 for DDL and Security.
then try these code...

Private Sub Command1_Click()
Dim tbl As New Table, cat As New ADOX.Catalog

' 1) Create the DataBase
cat.Create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Clients.mdb" & ";"
' 2) Create Table name "ClientsInfo"
tbl.Name = "ClientsInfo"
' 3) Add 3 Fields
tbl.Columns.Append "Name", adVarWChar, 50 'Text
tbl.Columns.Append "Age", adInteger 'Number
tbl.Columns.Append "Address", adLongVarWChar 'Memo
' 4) Save the Table to the DataBase
cat.Tables.Append tbl

'*********************** Use this to Open and/or Modify an existing DataBase **************
'Open the DataBase
'cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "\Clients.mdb" & ";"
'*********************************************************************************
MsgBox "Clients.mdb Created."
End Sub

hi frnd,
ADOX means Active Data Object extension.To create a databse using OLEDB and ADOX,
Required references : Microsoft Activex Data Objects 2.1 Library and Microsoft ADOExt 2.1 for DDL and Security.
then try these code...

Private Sub Command1_Click()
Dim tbl As New Table, cat As New ADOX.Catalog

' 1) Create the DataBase
cat.Create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Clients.mdb" & ";"
' 2) Create Table name "ClientsInfo"
tbl.Name = "ClientsInfo"
' 3) Add 3 Fields
tbl.Columns.Append "Name", adVarWChar, 50 'Text
tbl.Columns.Append "Age", adInteger 'Number
tbl.Columns.Append "Address", adLongVarWChar 'Memo
' 4) Save the Table to the DataBase
cat.Tables.Append tbl

'*********************** Use this to Open and/or Modify an existing DataBase **************
'Open the DataBase
'cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "\Clients.mdb" & ";"

sorry Robin but i dhdon'tave any idea on how to add records using Adodx.. ^^

This article has been dead for over six months. Start a new discussion instead.