如何将用变量表示数据库字段
数据库里存放数据的字段名为day,forcastime和1、2.....35。为什么执行后,就是1-35的字段数据前移了1个字段,forcastime的值被1覆盖了,35字段的数据为空了。
Filepath = App.Path + "\T639_Grid1.mdb"strn = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Filepath & ";Persist Security Info=FALSE" With Form1.Adodc1 .ConnectionString = strn .CommandType = adCmdText .RecordSource = "select * from T" .Refresh For i = 1 To 17 .Recordset.AddNew .Recordset.Fields("Day") = Date - 1 .Recordset.Fields("Forcastime") = (i - 1) * 3 For j = 1 To 35 .Recordset.Fields("j") = Tdata(i, j) '字段引用不对 Next Next .Recordset.Update End With