帮助原例自己多帮助吧
Sub CreateTable()
Dim tbl As New Table
Dim cat As New ADOX.Catalog
'打开目录。这里是示例数据库
cat.ActiveConnection = _
"rovider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\Program Files\Microsoft Office\" & _
"Office\Samples\Northwind.mdb;"
'如果你用自己的数据库的话则用
cat.ActiveConnection = CurrentProject.Connection
tbl.Name = "你的表名称"
tbl.Columns.Append "字段名1", adInteger
tbl.Columns.Append "字段名2", adInteger
tbl.Columns.Append "字段名3", adVarWChar, 50
cat.Tables.Append tbl
End Sub
[此贴子已经被作者于2002-10-15 13:38:05编辑过]
|