关于操作Access问题!
我用insert into语句操作Access时,里面的插入参数设置递增,但执行后数据库数值都是一个值,为什么?请各位提醒下!我的代码为:
Dim olecmd As OleDb.OleDbCommand = New OleDb.OleDbCommand
dbinit()
For i = 0 To 10
id = i + 1
Dim data As Double = 12.55 + i
olecmd.Connection = cnn
olecmd.CommandType = CommandType.Text
olecmd.CommandText = "insert into Group1 (Num,data,DAQTime) values (@Num,@data,@DAQTime)"
olecmd.Parameters.Add("@Num", OleDb.OleDbType.Char).Value = id
olecmd.Parameters.Add("@data", OleDb.OleDbType.Char).Value = data
olecmd.Parameters.Add("@DAQTime", OleDb.OleDbType.Char).Value = str
olecmd.ExecuteNonQuery()
Next
olecmd = Nothing
dbrelease()
执行后Num和Data都是同样的值,很奇怪,请问是什么问题呢?