Sub ADOCreateTable()
Dim cat As New ADOX.Catalog
Dim tbl As New ADOX.table
' Open the catalog
cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source= c:\windows\system\kamo.mdb;"
' Create a new Table object.
With tbl
.Name = categories.txtcategory.Text
' Create fields and append them to the new Table
' object. This must be done before appending the
' Table object to the Tables collection of the
' Catalog.
.Columns.Append "FilePath", adVarWChar
.Columns.Append "FileName", adVarWChar
.Columns.Append "Filesize", adVarWChar
.Columns.Append "Artist", adVarChar
.Columns.Append "Title", adVarChar
End With
' Add the new table to the database.
cat.Tables.Append tbl 'ERROR OCCURS HERE
Set cat = Nothing
End Sub