从数据库中检索记录时出现撇号错误 [英] Apostrophe error while retrieving the record from the database

查看:77
本文介绍了从数据库中检索记录时出现撇号错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在数据库中提交文本字段时,我使用Replace函数将单引号替换为double,即替换(q,,,, ;)

工作正常。当我从具有

撇号的数据库中检索字段时,我收到''Object expected''错误消息。有没有

的方法来解决这个问题?

谢谢,

Bhavna

解决方案



Bhavna写道:


我正在使用Replace函数将double引号替换为double

在数据库中提交一个文本字段,即替换(q,,,)

工作正常。当我从具有

撇号的数据库中检索字段时,我收到''Object expected''错误消息。即使我正在检查撇号的代码。对于例如strOutput = Replace(strOutput,"''""& quot;")

有没有办法解决这个问题?


谢谢,

Bhavna




Bhavna写道:


当我在数据库中提交文本字段时,我使用Replace函数将单引号替换为double,即替换(q,'',, '''')

工作正常。当我从具有

撇号的数据库中检索字段时,我收到''Object expected''错误消息。有没有

方法来解决这个问题?


谢谢,

Bhavna



当我从数据库中检索记录时,我正在检查

撇号。对于例如strOutput = Replace(strOutput,"''""& quot;")。

仍然我收到Object预期错误消息


您是否尝试过使用chr()?

strOutput =替换(strOutput,chr(34),chr(39))

。 。

" Bhavna" < bh ********** @ hotmail.comwrote in message

news:11 ******************** **@s13g2000cwa.googlegr oups.com ...


>

Bhavna写道:


当我在数据库中提交文本字段时,我使用Replace函数将单引号替换为double,即替换(q,'',, '''')

工作正常。当我从具有

撇号的数据库中检索字段时,我收到''Object expected''错误消息。有没有

方法来解决这个问题?

谢谢,

Bhavna



当我从数据库中检索记录时,我正在检查

撇号。对于例如strOutput = Replace(strOutput,"''""& quot;")。

仍然我收到Object预期错误消息


I am using a Replace function to replace single quotes with double when
submitting a text field in the database i.e. Replace (q, "''", "'' '' ")
which works fine. When I retrieve the field from the database which has
apostrophe I am getting ''Object expected'' error message. Is there a
way to fix this?
Thanks,
Bhavna

解决方案


Bhavna wrote:

I am using a Replace function to replace single quotes with double when
submitting a text field in the database i.e. Replace (q, "''", "'' '' ")
which works fine. When I retrieve the field from the database which has
apostrophe I am getting ''Object expected'' error message. Even though I am checking in the code for apostrophe. For e.g. strOutput = Replace(strOutput, "''", "&apos;")
Is there a way to fix this?
Thanks,
Bhavna



Bhavna wrote:

I am using a Replace function to replace single quotes with double when
submitting a text field in the database i.e. Replace (q, "''", "'' '' ")
which works fine. When I retrieve the field from the database which has
apostrophe I am getting ''Object expected'' error message. Is there a
way to fix this?
Thanks,
Bhavna

When I am retrieving the records from the db I am checking for
apostrophe. For e.g. strOutput = Replace(strOutput, "''", "&apos;").
Still I am getting Object expected error message


Have you tried using chr() instead?
strOutput = Replace(strOutput, chr(34), chr(39))
..
"Bhavna" <bh**********@hotmail.comwrote in message
news:11**********************@s13g2000cwa.googlegr oups.com...

>
Bhavna wrote:

I am using a Replace function to replace single quotes with double when
submitting a text field in the database i.e. Replace (q, "''", "'' '' ")
which works fine. When I retrieve the field from the database which has
apostrophe I am getting ''Object expected'' error message. Is there a
way to fix this?
Thanks,
Bhavna


When I am retrieving the records from the db I am checking for
apostrophe. For e.g. strOutput = Replace(strOutput, "''", "&apos;").
Still I am getting Object expected error message



这篇关于从数据库中检索记录时出现撇号错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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