Private Sub addmdb()
Dim databasePath As String = "D:\db45.mdb" '
Dim connectionString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & databasePath
Using connection As New OleDbConnection(connectionString)
Try
connection.Open()
Dim createTableSQL As String = "CREATE TABLE table1 (date1 DATE)"
Using command As New OleDbCommand(createTableSQL, connection)
command.ExecuteNonQuery()
End Using
Catch ex As OleDbException
Finally
connection.Close()
End Try
End Using
End Sub
一直提示 引发的异常:“System.Data.OleDb.OleDbException”(位于 System.Data.dll 中)
通过
Dim databasePath As String = "D:\db45.mdb" '
Try
File.Create(
databasePath)
Console.WriteLine("文件创建成功!")
Catch ex As IOException
Console.WriteLine("创建文件时出错: "
+ ex.Message)
End
Try
创建的mdb文件却无法读取
蓝板请帮忙看看
[此贴子已经被作者于2024/12/27 13:57:36编辑过]