This was working fine before. Now it gives an error: "Type is Invalid!" I've marked the line of code it occurs.
VB Code:
  1. Sub ADOCreateTable()
  2.  
  3.    Dim cat As New ADOX.Catalog
  4.    Dim tbl As New ADOX.table
  5.  
  6.    ' Open the catalog
  7.    cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
  8.       "Data Source= c:\windows\system\kamo.mdb;"
  9.  
  10.    ' Create a new Table object.
  11.    With tbl
  12.       .Name = categories.txtcategory.Text
  13.       ' Create fields and append them to the new Table
  14.       ' object. This must be done before appending the
  15.       ' Table object to the Tables collection of the
  16.       ' Catalog.
  17.       .Columns.Append "FilePath", adVarWChar
  18.       .Columns.Append "FileName", adVarWChar
  19.       .Columns.Append "Filesize", adVarWChar
  20.       .Columns.Append "Artist", adVarChar
  21.       .Columns.Append "Title", adVarChar
  22.    End With
  23.  
  24.    ' Add the new table to the database.
  25.    cat.Tables.Append tbl  'ERROR OCCURS HERE
  26.  
  27.    Set cat = Nothing
  28.    
  29.    
  30.  
  31. End Sub