asp.net BOF或EOF有一个是真,或者当前记录已被删除
我们这时要做的就是在使用Recordset对象的moveNext 等方法之前先利用RecordsetCount属性判断一下数据库中的数据是否为空方法: 实现代码如下: dim objRs as New Recordset dim objCn as New connection dim strSql
我们这时要做的就是在使用Recordset对象的moveNext 等方法之前先利用RecordsetCount属性判断一下数据库中的数据是否为空方法: 实现代码如下: dim objRs as New Recordset dim objCn as New connection dim strSql
if rs.bof then 表示:当前指针的位置是在第一行记录之前 if rs.eof then 表示:当前指针的位置是在最后一行记录之后 if not rs.eof then 表示:当前指针的位置没有到达最后一条记录 if not rs.bof then 表示:当前指针的位置没有到达第一条记录
记录集内随机取记录的代码 0) Then 记录集名称.MoveFirst Else 记录集名称.Requery End If 记录集名称_totalrn = -1 记录集名称_totalrn = 记录集名称.RecordCount ' ony works on some recordsets, b
0) Then记录集名称.MoveFirstElse记录集名称.RequeryEnd If记录集名称_totalrn = -1记录集名称_totalrn = 记录集名称.RecordCount ' ony works on some recordsets, but much fasterIf (记
实现代码如下:rs.open sql,conn,1,1if rs.eof and rs.bof thenresponse.write "还没找到文章"elsetotalPut=rs.recordcountmaxperpage=18if currentpagetotalput thenif (tota