(ADP)表单问题:“此Recordset不可更新” [英] (ADP) form problem: "This Recordset is not updatable"

查看:74
本文介绍了(ADP)表单问题:“此Recordset不可更新”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

配置:使用.ADP项目访问2002和SQL Server 2000.


我会非常感谢任何人对这个问题的投入我是有。


我在Access中有一个表单,不允许用户添加/更改/删除任何数据,显然是因为向间接使用的View添加了GROUP BY子句作为形式的记录来源。

我真的不相信这种限制需要存在,我希望有人能提出任何解决方案或解决方法。


具体 - 当用户尝试键入表单上的字段时,Access会发出蜂鸣声并显示此Recordset不可更新。在底部状态栏。


我有3个表,科目,研究和学习。这些都没有理想的名称,正如他们的描述所显示的那样:


" subject"是一个人表 - 每人一个记录

" study"是一个研究表(事件) - 每个记录描述一项研究。

研究是一个2列表,将主题记录与研究记录联系起来(多对多)


表:科目 - 每人一个记录

- -------------

subjectId uniqueidentifier 16< - PRIMARY KEY

lastName nvarchar 50

firstName nvarchar 30

middleName nvarchar 30

dob datetime 8

...

等(总计约80个字段)


表:学习 - 每项研究一项记录

------------

studyNumber nchar 8< - PRIMARY KEY

startDate datetime 8

endDate datetime 8


表:研究 - 将科目记录链接到研究记录(多对多)

--------------

subjectId uniqueidentifier 16

studyNumber nchar 8


在Access中,我有一个表单(单个表单 - 一个记录显示主要是允许观看/编辑主题表格。


最初,我将表格的记录来源作为主题。表格,一切都很好 - 我可以编辑表格中的记录。


我随后添加了在表格上仅显示主题年龄的功能。 />
我这样做是通过创建一个View(viewSubjectsMain)来简单地将一个新的(计算的)列添加到来自''subject'的那些,将表单的'Record Record'改为'viewSubjectsMain" ,并将表单的'Unique Table属性设置为subject。我使用了这种View方法,以便最终用户可以在表单中对此年龄字段进行过滤/排序。这也很好。


这里的后代视图代码(dob是出生日期):

Configuration: Access 2002 and SQL Server 2000 using a .ADP Project.


I would VERY MUCH appreciate anyone''s input into this problem I''m having.

I have a form in Access that does not permit the user to add/change/delete any data, apparently as a result of adding a GROUP BY clause to a View used indirectly as the form''s Record Source.
I really don''t believe that this restriction needs to be there, and I''m hoping that someone can suggest ANY solution or workaround.

To be specific -- when the user tries to type into a field on the form, Access beeps and displays "This Recordset is not updatable" in the bottom status bar.

I have 3 tables, subjects, studies, and study. These are not ideally named, as evident by their descriptions:

"subjects" is a person table -- one record per person
"study" is a table of studies (events) -- each record describes one study.
"studies" is a 2-column table linking subjects records to study records (many-to-many)

Table: subjects -- one record per person
---------------
subjectId uniqueidentifier 16 <- PRIMARY KEY
lastName nvarchar 50
firstName nvarchar 30
middleName nvarchar 30
dob datetime 8
...
etc (about 80 fields total)

Table: study -- one record per study
------------
studyNumber nchar 8 <- PRIMARY KEY
startDate datetime 8
endDate datetime 8

Table: studies -- link subjects records to study records (many-to-many)
--------------
subjectId uniqueidentifier 16
studyNumber nchar 8


In Access, I have a form ("Single Form" - one record displayed at a time) which primarily allows viewing/editing of the subjects table.

Initially, I had the Record Source of the form to be the "subjects" table, and all was fine -- I could edit the records in the form.

I subsequently added the ability to display-only the subject''s age on the form.
I did this by creating a View ("viewSubjectsMain") which simply added a new (calculated) column to those from ''subjects'', changing the form''s Record Source to "viewSubjectsMain", and setting the form''s Unique Table property to "subjects". I used this View approach so that the end-user can filter/sort on this age field in the form. This also worked fine.

Here''s that view code for posterity ("dob" is date-of-birth):

展开 | 选择 | Wrap | 行号

推荐答案

我认为任何Recordset定义(查询/表/视图)都是不可更新的,如果,当你问的时候你自己究竟应该做什么,你不能得到一个好的答案。

在一个GROUPed的Recordset中,没有办法知道如何更新记录在任何地方都不存在。

E好的,你有一个包含计算字段的View(甚至是一个Access QueryDef),它该怎么办?

如果它是智能,也许后者可以工作足以简单地更新那些非计算字段并忽略计算出的字段。

我担心在这个阶段我不能得到更多帮助 - 只是说你有什么试图做的不是我能看到的方式。

您可以尝试在SQL Server论坛中提出类似的问题。


最后,在所有令人不快的事情之后 - 很好地提出了问题!

我希望我们所有的成员都可以像这样清楚地发布。
I would think that any Recordset definition (Query / Table / view) would be non-updatable if, when you ask yourself exactly what the process should do, you can''t come up with a good answer.
In a Recordset that is GROUPed, there is no way of knowing how to update a record as those records don''t exist anywhere.
Equally, where you have a View (or even an Access QueryDef) which includes calculated fields, what should it do?
Maybe the latter could work if it''s intelligent enough simply to update those non-calculated fields and ignore the calculated ones.
I''m afraid I can''t be much more help at this stage - only to say that what you''re trying to do is not the way to go as far as I can see.
You may try asking a similar question in the SQL Server forum though.

Lastly, after all that unpalatable stuff - nicely laid out question!
I wish all our members could post as clearly as this.


嗨试试这个尺寸(微软报价):


"可更新视图可以修改视图中涉及的多个表。只要SQL Server可以明确地将用户的更新请求转换为视图定义中引用的基表中的更新,DELETE,INSERT和UPDATE语句就可以引用视图。


当使用多个表中涉及多个表的可更新视图时,预计行为会出现差异删除 INSERT ,或 更新语句。


恕我直言,单词明确地确认NeoPa的帖子。


HTH


Steve
Hi try this for size (Microsoft quote):

"Updatable views can modify more than one table involved in the view. The DELETE, INSERT, and UPDATE statements can reference a view as long as SQL Server can translate the user''s update request unambiguously to updates in the base tables referenced in the view''s definition.

Expect differences in behavior when working with updatable views with more than one table involved in theDELETE, INSERT, or UPDATE statements."

IMHO, the word "unambiguously" confirms NeoPa''s post.

HTH

Steve


谢谢史蒂夫,
这比它更好:)
Thanks Steve,
That puts it better than I could :)


这篇关于(ADP)表单问题:“此Recordset不可更新”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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