I have actually done this now, stuck on something else.
Heres the code for creating my blank access db
Sub createdb()
Dim strCon As String
Dim oCat As New ADOX.Catalog
strCon = oCat.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source = c:\new.mdb;"
End Sub
Now I am trying to create a table in that db with
Sub CreateAccessTable(StrDBPath As String)
Dim catDB As ADOX.Catalog
Dim tblNEW As ADOX.Table
Set catDB = New ADOX.Catalog
catDB.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & StrDBPath
Set tblNEW = New ADOX.Table
With tblNEW
.Name = "Contacts"
With .Columns
.Append "FirstName", adVarWChar
.Append "Lastname", adVarWChar
.Append "Phone", adVarWChar
.Append "Notes", adLongVarChar
End With
End With
catDB.Tables.Append tblNEW -----this keeps telling me its type is invalid!? WHY?????????????????????????????
Set catDB = Nothing
End Sub
Any help would be most appreciated
Simon