Dim db As Database '数据库对象定义
Dim dbName As String '数据库文件名
dbName = "NewDB.mdb"
Set db = CreateDatabase(dbName, dbLangChineseSimplified, dbEncrypt) '建立数据库
db.Execute "create table 表名 (field1 long,field2 text(8))" '添加表
db.Close
Set db = Nothing
'with ADOX
Sub CreateTable()
Dim tbl As New Table
Dim cat As New ADOX.Catalog
'Open the catalog.
' Open the Catalog.
cat.ActiveConnection = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\Program Files\Microsoft Office\" & _
"Office\Samples\Northwind.mdb;"