2008-05-01 22:14:04j69
建立新資料庫
********建立新資料庫*****************************
Dim cat As New ADOX.Catalog
cat.Create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:new.mdb"
*************************************************
建立表格範例
下列程式碼說明如何建立新的表格。
Sub CreateTable()
Dim tbl As New Table
Dim cat As New ADOX.Catalog
’ Open the Catalog.
cat.ActiveConnection = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:Program FilesMicrosoft Office" & _
"OfficeSamplesNorthwind.mdb;"
tbl.Name = "MyTable"
tbl.Columns.Append "Column1", adInteger
tbl.Columns.Append "Column2", adInteger
tbl.Columns.Append "Column3", adVarWChar, 50
cat.Tables.Append tbl
End Sub
Dim cat As New ADOX.Catalog
cat.Create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:new.mdb"
*************************************************
建立表格範例
下列程式碼說明如何建立新的表格。
Sub CreateTable()
Dim tbl As New Table
Dim cat As New ADOX.Catalog
’ Open the Catalog.
cat.ActiveConnection = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:Program FilesMicrosoft Office" & _
"OfficeSamplesNorthwind.mdb;"
tbl.Name = "MyTable"
tbl.Columns.Append "Column1", adInteger
tbl.Columns.Append "Column2", adInteger
tbl.Columns.Append "Column3", adVarWChar, 50
cat.Tables.Append tbl
End Sub
上一篇:VB6資料庫連接字串Access