错误2448在问题的上下文中没有意义 [英] Error 2448 does not make sense in the context of the problem

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

问题描述

Hello Access Gurus:


我使用Win98SE和Access97。

我刚刚构建了一个简单的Access97应用程序,它可以保存所有联系人
$ b我的个人联系人的$ b信息,例如名字,姓氏,

地址,城市,州等。

当用户想要搜索特定记录时,他做了两件

的东西:

1.在表格上是一个文本框,他在上面输入他正在搜索的文本

for。

2.然后他点击一个选项按钮,选择搜索

将在哪个字段上进行,例如,名字字段,姓氏字段等。 />
例如,点击名字和名字。选项按钮并输入John在文本

框中搜索名为John的联系人记录。

然后他点击一个cmdFind按钮,代码将过滤器应用到

表单并查找并显示基础表中的记录

包含在文本框中输入的文本。

问题是当我输入撇号时在搜索框中,我得到

错误消息错误2448.您无法为此对象分配值。

这没有意义我,因为我不是想给任何物品分配价值



我觉得我知道出了什么问题。当我把

撇号放在搜索字符串中时,Filter属性没有意义

因为撇号干扰了
$ b $的正确连接b过滤条件的不同部分(例如,Me.Filter = SearchField&

" Like''*"& SearchValue&" *''")其中SearchValue是值为

已过滤,即在文本框中输入的值。因此,如果输入了

撇号,则过滤条件完全错误。


这里是我的两个问题

1.如果这就是事情出错的原因,为什么我会收到错误

消息错误2448.你不能为这个对象赋值。它根据真正的问题似乎没有任何意义。

2.也许最重要的是:

有没有在包含帮助文件的网页上获取资源,以帮助开发人员了解导致某些错误消息的原因是什么?每个错误消息都有一个

ContextID,但是它们引用的帮助是什么?
文件?他们当然不是Access97的一部分。如果

这样的资源存在于网络上,对我来说将是非常有帮助的。


感谢任何可以帮助我的人。


Patrick


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

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

Hello Access Gurus:

I use Win98SE and Access97.
I just built a simple Access97 application which holds all contact
information for my personal contacts, such as first name, last name,
address, city, state, etc.
When the user wants to search for a particular record, he does two
things:
1. On the form is a text box on which he enters the text he is searching
for.
2. Then he clicks on an option button to choose which field the search
will be conducted on, e.g., First Name field, Last Name field, etc.
E.g., click the "First Name" option button and type "John" in the text
box to search for records of contacts named John.
Then he clicks a cmdFind button and the code applies a Filter to the
form and finds and displays the record in the underlying table that
contains the text that was entered in the text box.
The trouble is that when I enter an apostrophe in the Search box, I get
the error message "Error 2448. You can''t assign a value to this object."
This does not make sense to me because I''m not trying to assign a value
to any object.
I do think I know what is going wrong however. When I put the
apostrophe in the search string, the Filter property does not make sense
because the apostrophe interferes with the proper concatenation of the
different parts of the filter condition (e.g., Me.Filter = SearchField &
" Like ''*" & SearchValue & "*''") where SearchValue is the value to be
filtered on, i.e., the value that is entered in the textbox. So if an
apostrophe is entered, the Filter condition is all wrong.

HERE ARE MY TWO QUESTIONS
1. If that''s the reason things are going wrong, why do I get error
message "Error 2448. You can''t assign a value to this object." It
doesn''t seem to make sense based on what the real problem is.
2. Perhaps most importantly:
Is there any resouce on the web that contains Help files that help
developers to understand what causes certain error messages? There''s a
ContextID associated with each error message, but where are the help
files that they refer to? They''re certainly not part of Access97. If
such a resource existed on the web, it would be of great help to me.

Thanks to anyone who can help me with this.

Patrick


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

推荐答案

你没有提到哪一行给出了这个错误,但我猜它是

行将字符串分配给表单''的过滤器。如果是这样,Access就是

说你不能将字符串分配给过滤器 - 不是因为
过滤器不能接受字符串,而是因为尝试分配这个字符串

失败了。原因是失败的是你观察到的:额外的萎缩意味着

字符串格式不适合过滤器。


作为一种解决方法,你可以考虑在字符串中嵌入双引号:

strFilter =" Surname =""" &安培; Me.txtWhat2Find& """"

如果用户在字符串中输入双引号,那仍将是barf,但是

的频率会降低。如果你想进入下一个级别,你可以使用

替换()函数来替换""" """"""所以双引号字符

在字符串中加倍。啊:你正在使用A97,所以你会得到你自己的替换()



-

Allen Browne - 微软MVP。西澳大利亚州珀斯。

访问用户提示 - http:// allenbrowne.com/tips.html

回复群组,而不是mvps dot org的allenbrowne。


" DataBard007" <一个******* @ devdex.com>在消息中写道

news:3f ********************* @ news.frii.net ...
You don''t mention which line gives this error, but I''m guessing it''s the
line where you assign the string to the form''s Filter. If so, Access is
saying that you cannot assign the string to the filter - not becuase a
filter can''t accept a string, but because the attempt to assign this string
failed. The reason is failed is as you observed: the extra apostrophy means
the string is not well-formed for a filter.

As a workaround you might consider embedding double-quotes in the string:
strFilter = "Surname = """ & Me.txtWhat2Find & """"
That will still barf if the user enters a double-quote in the string, but
tha''ts less frequent. If you want to go the next level, you can use the
Replace() function to replace """" with """""" so the double-quote character
is doubled up within the string. Ah: you''re using A97, so you would have ot
write your own Replace().

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"DataBard007" <an*******@devdex.com> wrote in message
news:3f*********************@news.frii.net...
Hello Access Gurus:

我使用Win98SE和Access97。
我刚刚构建了一个简单的Access97应用程序,它保存了我的个人联系人的所有联系信息,例如名字,姓氏,地址,城市,州等。
当用户想要搜索特定记录时,他会做两件事:
1.表格上是他输入正在搜索的文本的文本框。
2.然后他点击一个选项按钮,选择搜索将在哪个字段进行,例如,名字字段,姓氏字段等。
例如,单击名字等。选项按钮并输入John在文本
框中搜索名为John的联系人记录。
然后他点击一个cmdFind按钮,代码将一个Filter应用到
表单,找到并显示基础表中的记录
包含在文本框中输入的文本。
麻烦的是,当我在搜索框中输入撇号时,我收到错误消息错误2448.您可以不给这个对象赋值。
这对我来说没有意义,因为我不是要为任何对象分配一个值。
我认为我知道出了什么问题。当我将
撇号放在搜索字符串中时,Filter属性没有意义
因为撇号干扰了过滤条件的不同部分(例如Me)的正确连接。 Filter = SearchField&
" Like''*"& SearchValue&" *''")其中SearchValue是要过滤的值,即值在文本框中输入。因此,如果输入了撇号,过滤条件都是错误的。

这是我的两个问题
1.如果这就是出错的原因,为什么我收到错误
消息错误2448.您无法为此对象分配值。根据真正的问题,它似乎没有意义。
2.也许最重要的是:
网上有任何包含帮助文件的资源吗?开发人员了解导致某些错误消息的原因是什么?每条错误消息都有一个与ContextID相关联的内容,但是它们引用的帮助文件在哪里?他们当然不是Access97的一部分。如果这样的资源存在于网络上,那对我来说将是非常有帮助的。

感谢任何可以帮助我的人。

Patrick
Hello Access Gurus:

I use Win98SE and Access97.
I just built a simple Access97 application which holds all contact
information for my personal contacts, such as first name, last name,
address, city, state, etc.
When the user wants to search for a particular record, he does two
things:
1. On the form is a text box on which he enters the text he is searching
for.
2. Then he clicks on an option button to choose which field the search
will be conducted on, e.g., First Name field, Last Name field, etc.
E.g., click the "First Name" option button and type "John" in the text
box to search for records of contacts named John.
Then he clicks a cmdFind button and the code applies a Filter to the
form and finds and displays the record in the underlying table that
contains the text that was entered in the text box.
The trouble is that when I enter an apostrophe in the Search box, I get
the error message "Error 2448. You can''t assign a value to this object."
This does not make sense to me because I''m not trying to assign a value
to any object.
I do think I know what is going wrong however. When I put the
apostrophe in the search string, the Filter property does not make sense
because the apostrophe interferes with the proper concatenation of the
different parts of the filter condition (e.g., Me.Filter = SearchField &
" Like ''*" & SearchValue & "*''") where SearchValue is the value to be
filtered on, i.e., the value that is entered in the textbox. So if an
apostrophe is entered, the Filter condition is all wrong.

HERE ARE MY TWO QUESTIONS
1. If that''s the reason things are going wrong, why do I get error
message "Error 2448. You can''t assign a value to this object." It
doesn''t seem to make sense based on what the real problem is.
2. Perhaps most importantly:
Is there any resouce on the web that contains Help files that help
developers to understand what causes certain error messages? There''s a
ContextID associated with each error message, but where are the help
files that they refer to? They''re certainly not part of Access97. If
such a resource existed on the web, it would be of great help to me.

Thanks to anyone who can help me with this.

Patrick



谢谢Allen:


是的,你对导致错误的那条线是正确的。

感谢你的建议,但我还是不知道:

1.为什么Access给出了这个特殊的错误信息,这不会给我

any关于问题的真正原因是什么的想法?

2.网络中是否有某个资源有帮助文件

帮助您确定导致问题的原因错误?在这种情况下,我能够找出问题的原因,但在另一种情况下,我可能会在没有帮助文件的情况下无法获得


谢谢。

Patrick


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

不要只是参加USENET ...获得奖励它!
Thanks Allen:

Yes, you were right about the line that caused the error.
Thanks for your suggestion, but I still don''t know:
1. Why Access gave this particular error message, which did not give me
any idea as to what the true cause of the problem was?
2. Is there a resource somewhere in the web that has Help files that
help you to determine what causes particular errors? In this case, I was
able to figure out the cause of the problem, but in another case, I may
not be able to without a help file.
Thank You.
Patrick

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


" DataBard007" <一个******* @ devdex.com>写道......
"DataBard007" <an*******@devdex.com> wrote...
是的,你对导致错误的那条线是正确的。
感谢你的建议,但我还是不知道:
1.为什么Access给出了这个特殊的错误信息,这并没有让我知道问题的真正原因是什么?


好​​吧,错误信息并不总是有用。通常,他们失败的水平是足够低,以至于失败的作品没有好的信息可以输入错误。这只是生活和花费更多时间

查看代码ethast导致错误和更少的时间尝试

了解何时错误消息模糊将最大化你的机会

成功。

2.网络中是否有某个资源包含帮助文件,以帮助您确定导致特定错误的原因?在这种情况下,我能够找出问题的原因,但在另一种情况下,我可能没有帮助文件。
Yes, you were right about the line that caused the error.
Thanks for your suggestion, but I still don''t know:
1. Why Access gave this particular error message, which did not give me
any idea as to what the true cause of the problem was?
Well, the error messages are not always helpful. Often the level at which
they fail is low enough that the piece that failed does not have good
information to put in an error. It is simply life and spending more time
looking at the code ethast caused the error and less time trying to
understand when the error message are obscure will maximize your chances of
success.
2. Is there a resource somewhere in the web that has Help files that
help you to determine what causes particular errors? In this case, I was
able to figure out the cause of the problem, but in another case, I may
not be able to without a help file.




真的不是这样的。一些错误消息是有帮助的,

有些不是。即使错误很好,良好的调试技巧也很重要,而且很有用。

-

MichKa [MS]

NLS整理/区域设置/键盘开发

全球化基础设施和字体技术


此帖子按原样提供。与

无保证,并且不授予任何权利。



There is really not something like this. Some error messages are helpful,
some are not. And even if the errors were great, good debugging skills are a
lot more important, and useful.
--
MichKa [MS]
NLS Collation/Locale/Keyboard Development
Globalization Infrastructure and Font Technologies

This posting is provided "AS IS" with
no warranties, and confers no rights.


这篇关于错误2448在问题的上下文中没有意义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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