Excel查询问题(急!急急!解决马上给分)
我查询如下表的时候当去最下面一行的时候,Rst.field(0) 是 Null,请高手们指点迷津,在这里先谢了!
A B C d e f g h
其他应收款---冯志坚
2003年 凭 证 摘 要 借方 贷方 借或贷 余额
月 日 字 号
8 7 42 扣住房设备款 20.00
vb代码如下:
Conn.Open "Driver={Microsoft Excel Driver (*.xls)};" & _
"DriverId=790;" & _
"Dbq=" & strFiles(j) & _
";DefaultDir=d:\财务;"
Rst.CursorLocation = adUseClient
Rst.CursorType = adOpenDynamic
Rst.LockType = adLockBatchOptimistic
Rst.Open "select * from [sheet1$]", Conn
Do While Rst.EOF = False
If Not IsNull(Rst.Fields(0)) Then
If IsNumeric(Trim(Rst.Fields(0))) Then
Flex.Rows = Flex.Rows + 1
For i = 0 To Rst.Fields.Count - 1
If IsNull(Rst.Fields(i)) = False Then
Flex.TextMatrix(intRow, i) = Rst.Fields(i)
Else
Flex.TextMatrix(intRow, i) = ""
End If
Next i
intRow = Flex.Rows
End If
End If
Rst.MoveNext
Loop
Rst.Close
Conn.Close
解决马上给50分(我分不多了)