送分题,变量在赋值前被使用,可能会在运行时导致空引用异常
................
Dim zd1 As String
Dim a() As String
Dim i As Integer
zd1 = myDataset1.Tables(0).Rows(s).Item("日期") & ""
a(i) = myDataset1.Tables(0).Rows(s).Item("加工个数")
sql = "INSERT INTO tu (日期,A,B,C) VALUES('" & a(i) & "')"
MyCommand = New OleDbCommand(sql, cn)
MyCommand.ExecuteNonQuery()
'Next
MsgBox("导入成功!")
为什么结果是变量在赋值前被使用,可能会在运行时导致空引用异常???请高手赐教