记录集 [英] recordsets

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

问题描述

我在查询中使用了记录集,但只引用了sql字符串而

不是查询。我试图引用一个已经创建的查询,但是它已经下降了

结束。


我的工作原理:

dim Rst2 as DAO.Recordset

设置Rst2 = db.OpenRecordset(StrSelectPrior)

Rst2.MoveLast

Me.TxtPrior.Value = Rst2.RecordCount


这不是:

Dim Rst3为DAO.Recordset

设置Rst3 = db.OpenRecordset(" Myexistingquery")


它在最后一行说不到找到对象。


我们非常感谢你的帮助。


问候

彼得

I have used recordsets in my query but only referenceing an sql string and
not a query. I tried to reference a query that was created but it falls
over.

I have that works:
dim Rst2 as DAO.Recordset
Set Rst2 = db.OpenRecordset(StrSelectPrior)
Rst2.MoveLast
Me.TxtPrior.Value = Rst2.RecordCount

This doesnt:
Dim Rst3 as DAO.Recordset
Set Rst3 = db.OpenRecordset("Myexistingquery")

it falls over on the last line by saying object not found.

Your help would be much appreciated.

Regards
Peter

推荐答案

彼得,


你的避风港没有定义对象变量db。添加以下作为第2行

和3:

Dim Db作为DAO.Database

设置Db = CurrentDb()


-

PC数据表

您的资源以获取Access,Excel和Word应用程序的帮助
re ****** @ pcdatasheet.com
www.pcdatasheet.com

" Peter Bailey" < PE ********* @ andaluz.fsbusiness.co.uk>在消息中写道

news:ci ********** @ newsg3.svr.pol.co.uk ...
Peter,

You haven''t defined the object variable "db". Add the following as lines 2
and 3:
Dim Db As DAO.Database
Set Db = CurrentDb()

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Peter Bailey" <pe*********@andaluz.fsbusiness.co.uk> wrote in message
news:ci**********@newsg3.svr.pol.co.uk...
我使用过记录集我的查询,但只引用一个SQL字符串,而不是一个查询。我试图引用一个已经创建的查询,但它已经结束了。

我的工作原理是:
dim Rst2 as DAO.Recordset
设置Rst2 = db。 OpenRecordset(StrSelectPrior)
Rst2.MoveLast
Me.TxtPrior.Value = Rst2.RecordCount

这不是:
Dim Rst3为DAO.Recordset
设置Rst3 = db.OpenRecordset(Myexistingquery)

它会在最后一行说不到找到的对象。

非常感谢你的帮助。

问候
彼得
I have used recordsets in my query but only referenceing an sql string and
not a query. I tried to reference a query that was created but it falls
over.

I have that works:
dim Rst2 as DAO.Recordset
Set Rst2 = db.OpenRecordset(StrSelectPrior)
Rst2.MoveLast
Me.TxtPrior.Value = Rst2.RecordCount

This doesnt:
Dim Rst3 as DAO.Recordset
Set Rst3 = db.OpenRecordset("Myexistingquery")

it falls over on the last line by saying object not found.

Your help would be much appreciated.

Regards
Peter



抱歉,我没有提及他们的定义,如下所示。

" PC数据表" <无**** @ nospam.spam>在消息中写道

新闻:e7 ***************** @ newsread3.news.atl.earthl ink.net ...
sorry I didnt mention those they are defined as you set out below.
"PC Datasheet" <no****@nospam.spam> wrote in message
news:e7*****************@newsread3.news.atl.earthl ink.net...
彼得,

你还没有定义对象变量db。添加以下作为第2行和第3行:
Dim Db作为DAO.Database
设置Db = CurrentDb()

- PC数据表
您的资源以获取Access,Excel和Word应用程序的帮助
re ****** @ pcdatasheet.com
www.pcdatasheet.com

Peter Bailey < PE ********* @ andaluz.fsbusiness.co.uk>在消息中写道
新闻:ci ********** @ newsg3.svr.pol.co.uk ...
Peter,

You haven''t defined the object variable "db". Add the following as lines 2
and 3:
Dim Db As DAO.Database
Set Db = CurrentDb()

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Peter Bailey" <pe*********@andaluz.fsbusiness.co.uk> wrote in message
news:ci**********@newsg3.svr.pol.co.uk...
我在查询中使用过记录集但只有引用sql字符串
而不是查询。我试图引用一个已经创建的查询,但它已经结束了。

我的工作原理是:
dim Rst2 as DAO.Recordset
设置Rst2 = db。 OpenRecordset(StrSelectPrior)
Rst2.MoveLast
Me.TxtPrior.Value = Rst2.RecordCount

这不是:
Dim Rst3为DAO.Recordset
设置Rst3 = db.OpenRecordset(Myexistingquery)

它会在最后一行说不到找到的对象。

非常感谢你的帮助。

问候
彼得
I have used recordsets in my query but only referenceing an sql string and not a query. I tried to reference a query that was created but it falls
over.

I have that works:
dim Rst2 as DAO.Recordset
Set Rst2 = db.OpenRecordset(StrSelectPrior)
Rst2.MoveLast
Me.TxtPrior.Value = Rst2.RecordCount

This doesnt:
Dim Rst3 as DAO.Recordset
Set Rst3 = db.OpenRecordset("Myexistingquery")

it falls over on the last line by saying object not found.

Your help would be much appreciated.

Regards
Peter




仔细检查!你有DAO吗?在数据库面前?你有展示的Set Db

声明吗?


Steve

PC数据表

Peter Bailey < PE ********* @ andaluz.fsbusiness.co.uk>在消息中写道

news:ci ********** @ news8.svr.pol.co.uk ...
Double Check! Do you have "DAO" in front of database? Do you have the Set Db
statement as I showed?

Steve
PC Datasheet
"Peter Bailey" <pe*********@andaluz.fsbusiness.co.uk> wrote in message
news:ci**********@news8.svr.pol.co.uk...
抱歉我没有提到那些它们的定义如下所示。
PC数据表 <无**** @ nospam.spam>在消息中写道
新闻:e7 ***************** @ newsread3.news.atl.earthl ink.net ...
sorry I didnt mention those they are defined as you set out below.
"PC Datasheet" <no****@nospam.spam> wrote in message
news:e7*****************@newsread3.news.atl.earthl ink.net...
Peter ,

你还没有定义对象变量db。添加以下行作为行
2
Peter,

You haven''t defined the object variable "db". Add the following as lines 2
和3:
Dim Db作为DAO.Database
设置Db = CurrentDb()< PC数据表
您的资源获取Access,Excel和Word应用程序的帮助
re ****** @ pcdatasheet.com
www .pcdatasheet.com

" Peter Bailey" < PE ********* @ andaluz.fsbusiness.co.uk>在消息中写道
新闻:ci ********** @ newsg3.svr.pol.co.uk ...
and 3:
Dim Db As DAO.Database
Set Db = CurrentDb()

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Peter Bailey" <pe*********@andaluz.fsbusiness.co.uk> wrote in message
news:ci**********@newsg3.svr.pol.co.uk...
我在查询中使用过记录集但只有引用sql字符串
I have used recordsets in my query but only referenceing an sql string


而不是查询。我尝试引用一个创建的查询,但是
掉了。

我有它的工作原理:
dim Rst2 as DAO.Recordset
设置Rst2 = db。 OpenRecordset(StrSelectPrior)
Rst2.MoveLast
Me.TxtPrior.Value = Rst2.RecordCount

这不是:
Dim Rst3为DAO.Recordset
设置Rst3 = db.OpenRecordset(Myexistingquery)

它会在最后一行说不到找到的对象。

非常感谢你的帮助。

问候
Peter


and not a query. I tried to reference a query that was created but it falls over.

I have that works:
dim Rst2 as DAO.Recordset
Set Rst2 = db.OpenRecordset(StrSelectPrior)
Rst2.MoveLast
Me.TxtPrior.Value = Rst2.RecordCount

This doesnt:
Dim Rst3 as DAO.Recordset
Set Rst3 = db.OpenRecordset("Myexistingquery")

it falls over on the last line by saying object not found.

Your help would be much appreciated.

Regards
Peter





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

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