查询错误消息 [英] Query Error Message

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

问题描述

在2000模式下使用AccessXP。


我有下表---

TblLocation

LocationID

PropertyID

StateID

CountyID

CityID


TblState

StateID

状态

两个表中的StateID之间存在类型1关系。我基于这两个表创建了一个

查询,其中包括TblLocation中的所有字段和

TblState中的State字段。

查询中的两个表之间连接了StateID。如果我运行查询,为PropertyID输入1,然后尝试关闭

查询,我收到以下错误消息:

" Microsoft Jet数据库引擎不能在表格中找到一条记录

''TblState''与关键字匹配字段''StateID''。

当我点击确定时会显示以下消息:

"你现在无法保存记录。

如果我删除表格之间的相关关系,我会得到相同的行为

依赖于查询中的连接。

为什么我收到此错误消息?


谢谢,


Tom

Using AccessXP in 2000 mode.

I have the following tables ---
TblLocation
LocationID
PropertyID
StateID
CountyID
CityID

TblState
StateID
State

A Type 1 relationship exists between StateID in both tables. I created a
query based on both tables that includes all the fields in TblLocation and
the State field in TblState. StateID is joined between the two tables in the
query. If I run the query, enter 1 for PropertyID and then try to close the
query, I get the following error message:
"The Microsoft Jet Database Engine can not find a record in the table
''TblState'' with key matching field(s) ''StateID''.
When I click OK this message appears:
"You can not save the record at this time".
I get the same behaviour if I delete the relatinship between the tables and
just rely on the join in the query.
Why do I get this error message?

Thanks,

Tom

推荐答案

Tom写道:
在2000模式下使用AccessXP。

我有下表---
TblLocation
LocationID
PropertyID
StateID
CountyID
CityID

TblState
StateID <状态

StateID i之间存在类型1关系两张桌子。我基于两个表创建了一个
查询,其中包括TblLocation中的所有字段和TblState中的State字段。
查询中的两个表之间连接了StateID。如果我运行查询,为PropertyID输入1,然后尝试关闭
查询,我收到以下错误消息:
Microsoft Jet数据库引擎无法在表中找到记录
''TblState''与键匹配字段''StateID''。
当我单击OK时,会显示以下消息:
此时无法保存记录。<如果我删除表之间的关系并且只依赖于查询中的连接,我会得到相同的行为。
为什么我会收到此错误消息?

谢谢,

Tom
Using AccessXP in 2000 mode.

I have the following tables ---
TblLocation
LocationID
PropertyID
StateID
CountyID
CityID

TblState
StateID
State

A Type 1 relationship exists between StateID in both tables. I created a
query based on both tables that includes all the fields in TblLocation and
the State field in TblState. StateID is joined between the two tables in the
query. If I run the query, enter 1 for PropertyID and then try to close the
query, I get the following error message:
"The Microsoft Jet Database Engine can not find a record in the table
''TblState'' with key matching field(s) ''StateID''.
When I click OK this message appears:
"You can not save the record at this time".
I get the same behaviour if I delete the relatinship between the tables and
just rely on the join in the query.
Why do I get this error message?

Thanks,

Tom



您是否正在添加新记录?你输入了StateID吗?如果没有输入StateID

,则无法链接到状态表。


Are you adding a new record? Have you entered a StateID? If no StateID
is entered, there is nothing to link to the state table.


为什么需要StateID?我的意思是,如果你正在与美国各州打交道,那么他们已经是独一无二的了,只有2个字符。我只需使用

状态字段然后在我的表单中使用组合框。


SELECT状态

FROM tblState

按州订购


并完成。 IMO,你让它变得比它更复杂

需要。

Why do you need a StateID? I mean, if you''re dealing with US states,
then they''re already unique, and only 2 characters long. I''d just use
the State field and then use a combobox in my form.

SELECT State
FROM tblState
ORDER BY State

and be done with it. IMO, you''re making this more complicated than it
needs to be.


感谢您的回复!


我认为在外键字段中允许空值。无法访问

应用外键必须与主要'

表'字段中的记录匹配的规则或为空? StateID是外键。


Tom

" Salad" < oi*@vinegar.com>在消息中写道

news:uF ************** @ newsread3.news.pas.earthlink .net ...
Thanks for responding!

I thought null values are allowed in foreign key fields. Doesn''t Access
apply the rule that the foreign key must match a record in the primary''s
table''s field or be null? StateID is a foreign key.

Tom
"Salad" <oi*@vinegar.com> wrote in message
news:uF**************@newsread3.news.pas.earthlink .net...
Tom写道:
在2000模式下使用AccessXP。

我有以下表格---
TblLocation
LocationID
PropertyID
StateID
CountyID
CityID

TblState
StateID
状态

两个表中的StateID之间存在类型1关系。我基于两个表创建了一个
查询,其中包括TblLocation中的所有字段和TblState中的State字段。 StateID在查询中的两个表之间加入
。如果我运行查询,为PropertyID输入1,然后尝试关闭查询,我收到以下错误消息:
Microsoft Jet数据库引擎无法在表中找到记录
''TblState''与键匹配字段''StateID''。
当我单击OK时,会显示以下消息:
此时无法保存记录。<如果我删除表格之间的关系并且只依赖于查询中的连接,我会得到相同的行为。
为什么我会收到此错误消息?

谢谢,

Tom
Using AccessXP in 2000 mode.

I have the following tables ---
TblLocation
LocationID
PropertyID
StateID
CountyID
CityID

TblState
StateID
State

A Type 1 relationship exists between StateID in both tables. I created a
query based on both tables that includes all the fields in TblLocation
and the State field in TblState. StateID is joined between the two tables
in the query. If I run the query, enter 1 for PropertyID and then try to
close the query, I get the following error message:
"The Microsoft Jet Database Engine can not find a record in the table
''TblState'' with key matching field(s) ''StateID''.
When I click OK this message appears:
"You can not save the record at this time".
I get the same behaviour if I delete the relatinship between the tables
and just rely on the join in the query.
Why do I get this error message?

Thanks,

Tom


您是否正在添加新记录?你输入了StateID吗?如果没有输入StateID
,则无法链接到状态表。


Are you adding a new record? Have you entered a StateID? If no StateID
is entered, there is nothing to link to the state table.



这篇关于查询错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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