用ADO能不能创建Access数据库?
---------------------------------------------------------------
创建一个数据库:
首先在项目中添加引用->Microsoft ADO Ext. 2.x for DLL and Security
然后看下面的代码,创建一个数据库:
Public Function CreateDatabase(DBPath As String) As Boolean
On Error Resume Next
Dim oCatalog As New ADOX.Catalog
oCatalog.Create _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBPath
CreateDatabase = Err.Number = 0
End Function
调用:CreateDatabase ("c:\1.mdb")
创建表可以用SQL语句。