Shu*_*ham 26 ms-access access-vba
如何测试记录集是否为空?
Dim temp_rst1 As Recordset
Dim temp_rst2 As Recordset
Set temp_rst1 = db.OpenRecordset("SELECT * FROM ORDER_DATA WHERE SKUS_ORDERED = '" & curSKU1 & "' AND [ORDER] = " & curOrder)
Set temp_rst2 = db.OpenRecordset("SELECT * FROM ORDER_DATA WHERE SKUS_ORDERED = '" & curSKU2 & "' AND [ORDER] = " & curOrder)
If IsNull(temp_rst1) Or IsNull(temp_rst2) Then MsgBox "null"
Run Code Online (Sandbox Code Playgroud)
我正在根据select语句打开几个记录集.如果没有记录,IsNull会返回true吗?
mwo*_*e02 41
我会检查"文件结束"标志:
If temp_rst1.EOF Or temp_rst2.EOF Then MsgBox "null"
Run Code Online (Sandbox Code Playgroud)
Tom*_*dee 11
RecordCount是您想要使用的.
If Not temp_rst1.RecordCount > 0 ...
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
155325 次 |
最近记录: |