只是为了让你知道这是我在这个网站上发布的第一个问题,所以如果我错过了任何事情,请告诉我。我遇到的问题是,当程序运行时,我收到以下错误消息
FROM 子句中的语法错误
代码在这里
Dim dbProvider As String
Dim dbSource As String
Dim con As New OleDb.OleDbConnection
Dim ds As New DataSet
Dim MaxRows As Integer
Dim sql As String
Dim TableName As String
Dim TableCreate As New OleDb.OleDbCommand("CREATE TABLE [" & TableName & "](" & "ID INTEGER NOT NULL," & ")", con)
Dim da As New OleDb.OleDbDataAdapter("SELECT * FROM [" & TableName & "]", con)
Dim cb As New OleDb.OleDbCommandBuilder(da)
TableName = TbTableName.Text
dbProvider = "PROVIDER=Microsoft.Jet.OLEDB.4.0;"
dbSource = "Data Source = E:\A2 Computing\Project\PasswordDatabase.mdb"
con.ConnectionString = dbProvider & dbSource
con.Open()
da.Fill(ds, "NewTable")
MaxRows = ds.Tables("NewTable").Rows.Count
我遇到的问题是在这条线上
da.Fill(ds, "NewTable")
我不确定我错过了什么,当我声明 tablecreate 或 da 时,我猜测它与括号有关?=S 任何帮助将不胜感激。=)