记录集中没有记录计数 [英] not getting record count in recordset

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

问题描述

我正在使用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


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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆