错误3251,记录集!@#$%^& *() [英] Error 3251, Recordsets !@#$%^&*()

查看:84
本文介绍了错误3251,记录集!@#$%^& *()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在Win-XP下使用Access-2k ...

当我有一个带嵌入代码的表单时,它的工作非常完美。例如

以下代码示例。


Dim db as DAO.Database

Dim rs as DAO.Recordset


设置db = CurrentDB

set rs = db.OpenRecordset(" MyTable")

rs.FindFirst" UPC =" &安培; upcno


但是,当我在任何表格之外的模块中使用相同的代码时,我会收到

以下消息:


运行时错误3251

此类对象不支持操作。


我通常通过删除&b来解决这个问题。使用FindFirst"并且

按顺序搜索,直到我找到有问题的记录。但是我对于Recordset Objects的理解缺少了一些东西。

请帮我澄清一下。


TIA

Tim Hunter



***通过Developersdex发送 http://www.developersdex.com ***

不要只是参加USENET ......获得奖励!

Hi,
I''m using Access-2k under Win-XP...
When I have a form with imbedded code it works perfect. Such as the
following code example.

Dim db as DAO.Database
Dim rs as DAO.Recordset

Set db = CurrentDB
set rs = db.OpenRecordset("MyTable")
rs.FindFirst "UPC=" & upcno

BUT, when I use this same code in a module outside of any form I get the
following message:

Run-time error 3251
Operation is not supported for this kind of object.

I usually get around this problem by removing the "FindFirst" and
sequentially searching until I find the record in question. But I am
missing something in my understanding of Recordset Objects.
Please help me clear this up.

TIA
Tim Hunter


*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!

推荐答案

2003年10月18日15:51:28 GMT,Frusterated< Fr ********* @ AccessHelp.com>

写道:


假设upcno是一个传递给你的函数的变量,而不是一个字段

引用不再有效,而不是错误的数据类型

(应该是数字),那么你的代码看起来很好,你的机器可能会搞砸了b
。在另一台机器上试试。加载最新服务

包。


-Tom。

On 18 Oct 2003 15:51:28 GMT, Frusterated <Fr*********@AccessHelp.com>
wrote:

Assuming upcno is a variable passed into your function and not a field
reference that is no longer valid, and not of the wrong datatype
(should be numeric), then your code looks fine, and your machine may
be screwed up. Try it on another machine. Load the latest service
packs.

-Tom.

我在Win-XP下使用Access-2k ......
当我有一个嵌入代码的表单时,它非常完美。如下面的代码示例。

Dim db as DAO.Database
Dim rs as DAO.Recordset

设置db = CurrentDB set rs = db.OpenRecordset(" MyTable")
rs.FindFirst" UPC =" &安培; upcno

但是,当我在任何形式之外的模块中使用相同的代码时,我得到以下消息:

运行时错误3251 这种对象不支持操作。

我通常通过删除FindFirst来解决这个问题。并按顺序搜索,直到我找到有问题的记录。但是我对Recordset Objects的理解遗漏了一些东西。
请帮我澄清一下。

TIA
Tim Hunter


***通过开发人员指南 http://www.developersdex.com 发送* **
不要只是参加USENET ......获得奖励!
Hi,
I''m using Access-2k under Win-XP...
When I have a form with imbedded code it works perfect. Such as the
following code example.

Dim db as DAO.Database
Dim rs as DAO.Recordset

Set db = CurrentDB
set rs = db.OpenRecordset("MyTable")
rs.FindFirst "UPC=" & upcno

BUT, when I use this same code in a module outside of any form I get the
following message:

Run-time error 3251
Operation is not supported for this kind of object.

I usually get around this problem by removing the "FindFirst" and
sequentially searching until I find the record in question. But I am
missing something in my understanding of Recordset Objects.
Please help me clear this up.

TIA
Tim Hunter


*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!






如果MyTable是*链接*表,你必须在openrecordset调用中使用dbOpenDynaset参数

,如果你想使用Seek?...查找?

上记录集的方法。我不记得哪个,&我没有在这里查看。

尝试改变&看看是否有帮助。


HTH,

TC

" Frusterated" <星期五********* @ AccessHelp.com>在消息中写道

news:3f ********************* @ news.frii.net ...
If MyTable is a *linked* table, you have to use the dbOpenDynaset parameter
on the openrecordset call if you want to use the Seek?...Find? methods on
that recordset. I don''t remember which, & I don''t have Access here to check.
Try that change & see if it helps.

HTH,
TC
"Frusterated" <Fr*********@AccessHelp.com> wrote in message
news:3f*********************@news.frii.net...

我在Win-XP下使用Access-2k ......
当我有一个嵌入代码的表单时,它的工作非常完美。如下面的代码示例。

Dim db as DAO.Database
Dim rs as DAO.Recordset

设置db = CurrentDB set rs = db.OpenRecordset(" MyTable")
rs.FindFirst" UPC =" &安培; upcno

但是,当我在任何形式之外的模块中使用相同的代码时,我得到以下消息:

运行时错误3251 这种对象不支持操作。

我通常通过删除FindFirst来解决这个问题。并按顺序搜索,直到我找到有问题的记录。但是我对Recordset Objects的理解遗漏了一些东西。
请帮我澄清一下。

TIA
Tim Hunter


***通过开发人员指南 http://www.developersdex.com 发送* **
不要只是参加USENET ......获得奖励!
Hi,
I''m using Access-2k under Win-XP...
When I have a form with imbedded code it works perfect. Such as the
following code example.

Dim db as DAO.Database
Dim rs as DAO.Recordset

Set db = CurrentDB
set rs = db.OpenRecordset("MyTable")
rs.FindFirst "UPC=" & upcno

BUT, when I use this same code in a module outside of any form I get the
following message:

Run-time error 3251
Operation is not supported for this kind of object.

I usually get around this problem by removing the "FindFirst" and
sequentially searching until I find the record in question. But I am
missing something in my understanding of Recordset Objects.
Please help me clear this up.

TIA
Tim Hunter


*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!



On Sun,2003年10月19日17:32 :32 + 1200,TC < a@b.c.d>写道:


我认为OpenDynaset是默认的,如果你没有指定参数。


Seek对附加表不起作用。如果你想使用它,你需要

来首先打开一个代表后端数据库的数据库对象。


然而,Tim正在使用FindFirst,它应该可以工作在所有情况下。


-Tom。

On Sun, 19 Oct 2003 17:32:32 +1200, "TC" <a@b.c.d> wrote:

I think OpenDynaset is the default, if you don''t specify the argument.

Seek does not work on attached tables. If you want to use it, you need
to first open a database object representing the backend database.

However, Tim is using FindFirst, which should work in all situations.

-Tom.

如果MyTable是*链接*表,则必须使用dbOpenDynaset参数
在openrecordset调用上如果你想使用Seek?...查找?关于记录集的方法。我不记得哪个,&我没有访问这里查看。
尝试改变&看看是否有帮助。

HTH,
TC

" Frusterated" <星期五********* @ AccessHelp.com>在消息中写道
新闻:3f ********************* @ news.frii.net ...
If MyTable is a *linked* table, you have to use the dbOpenDynaset parameter
on the openrecordset call if you want to use the Seek?...Find? methods on
that recordset. I don''t remember which, & I don''t have Access here to check.
Try that change & see if it helps.

HTH,
TC
"Frusterated" <Fr*********@AccessHelp.com> wrote in message
news:3f*********************@news.frii.net...

我在Win-XP下使用Access-2k ......
当我有一个嵌入代码的表单时,它的工作非常完美。如下面的代码示例。

Dim db as DAO.Database
Dim rs as DAO.Recordset

设置db = CurrentDB set rs = db.OpenRecordset(" MyTable")
rs.FindFirst" UPC =" &安培; upcno

但是,当我在任何形式之外的模块中使用相同的代码时,我得到以下消息:

运行时错误3251 这种对象不支持操作。

我通常通过删除FindFirst来解决这个问题。并按顺序搜索,直到我找到有问题的记录。但是我对Recordset Objects的理解遗漏了一些东西。
请帮我澄清一下。

TIA
Tim Hunter


***通过开发人员指南 http://www.developersdex.com 发送* **
不要只是参加USENET ......获得奖励!
Hi,
I''m using Access-2k under Win-XP...
When I have a form with imbedded code it works perfect. Such as the
following code example.

Dim db as DAO.Database
Dim rs as DAO.Recordset

Set db = CurrentDB
set rs = db.OpenRecordset("MyTable")
rs.FindFirst "UPC=" & upcno

BUT, when I use this same code in a module outside of any form I get the
following message:

Run-time error 3251
Operation is not supported for this kind of object.

I usually get around this problem by removing the "FindFirst" and
sequentially searching until I find the record in question. But I am
missing something in my understanding of Recordset Objects.
Please help me clear this up.

TIA
Tim Hunter


*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!






这篇关于错误3251,记录集!@#$%^&amp; *()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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