本文介绍了记录集中没有记录计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我正在使用Windows 2007并尝试​​获取记录计数,但它返回-1

I am using windows 2007 and trying to get record count but it is returning -1

以下是我的代码

设置objcon = CreateObject(" ADODB.connection")

设置myrecordset = CreateObject(" ADODB.recordset")

ConnectionString =" provider = sqloledb; Trusted_Connection = Yes" ;
$
objcon.Open ConnectionString," sa",""

Set objcon = CreateObject("ADODB.connection")
Set myrecordset = CreateObject("ADODB.recordset")
ConnectionString = "provider=sqloledb;Trusted_Connection=Yes"
objcon.Open ConnectionString, "sa", ""

myrecordset.CursorLocation = adUseClient

myrecordset.CursorLocation = adUseClient

设置myrecordset = objcon.Execute(strSQLQuery1)

Set myrecordset = objcon.Execute(strSQLQuery1)

MsgBox myrecordset.RecordCount'这是返回-1而不是78。

MsgBox myrecordset.RecordCount ' this is returning -1 instead of 78.

请帮忙,我有尝试了各种光标位置

Kindly help ,I have tried various cursor locations

推荐答案

myrecordset.MoveLast

myrecordset.MoveLast


这篇关于记录集中没有记录计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-08 00:18