- 在ACCESS中创建一个新表,应该怎么做啊,表的结构为MIT(double),Height(double),Area(double)
Dim SourceTableName As String = Yuanbiao.Text
Dim MyTableName As String = Xinbiao.Text
'创建新表
Dim MySql As String = "CREATE TABLE " + MyTableName + " (MyMt integer,Area double,Height double,MK INT) "
Dim myconn As New System.Data.OleDb.OleDbConnection
Dim strcnn As String
strcnn = "Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" & _
"ocking Mode=1;Data Source=""newdata.mdb"";Jet OLEDB:Engine Type=5;Provider=""Microsoft.J" & _
"et.OLEDB.4.0"";Jet OLEDB:System database=;Jet OLEDB:SFP=False;persist security in" & _
"fo=False;Extended Properties=;Mode=Share Deny None;Jet OLEDB:Encrypt Database=Fa" & _
"lse;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't Copy Locale on Compac" & _
"t=False;Jet OLEDB:Compact Without Replica Repair=False;User ID=Admin;Jet OLEDB:G" & _
"lobal Bulk Transactions=1"
myconn.ConnectionString = strcnn
myconn.Open()
Dim mycommand As New OleDb.OleDbCommand(MySql, myconn)
mycommand.Connection.ConnectionString = myconn.ConnectionString
mycommand.CommandText = MySql
mycommand.Connection = myconn
mycommand.ExecuteNonQuery()
myconn.Close()
总是出错,创建不了呢,在这句mycommand.Connection.ConnectionString = myconn.ConnectionString有错误