Access中的是/否 [英] yes/no in Access

查看:139
本文介绍了Access中的是/否的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天前,我发布了一个问题,为什么我的简单表格不是
工作。我在浏览器中遇到的错误是:

标准表达式中的数据类型不匹配。

/grace/shapethankyou.asp,第197行


当我尝试在Access 2000中运行它时得到的错误是它是类型

转换失败


SQL声明是:

INSERT INTO

个人(FName,LName,PreferredName,DayPhone,Evenin gPhone,ContactTime,电子邮件,F

irstBase,Gift1 ,Gift2,Gift3,baby)VALUES

(''test'','''','''','''','''','''''''' '',''','''','''','''',''1')


你在那里看到的所有字段,最后一个例外,是文字

字段。用户可以在Web表单中手动键入他们想要的任何内容。在

数据库中,它们主要定义为文本,一个或两个是日期时间。


最后一个是复选框(我有更多,但是现在注释掉,直到我获得这个工作的
)。我将复选框设置为值是,并且我/ b $ b得到了同样的错误,所以我在这个论坛上发了一个问题。这是

向我解释,Access需要将1或0传递给定义的字段

as yes / no。我尝试了这个,因为你可以从上面的SQL插入语句,

和我得到相同的错误。我甚至尝试过开启,但它没有用。


此声明中的所有字段都被定义为不需要,声明

当最后一个字段不包括在内时工作正常。


我很困惑。你能帮帮忙吗?


免责声明:我已经习惯了SQL Server,但是这个教会网站项目必须在Access中完成。\\ br
。 >

A couple of days ago, I posted a qusstion as to why my simple form isn''t
working. The error I get in the browser is:
Data type mismatch in criteria expression.
/grace/shapethankyou.asp, line 197

The error I get when I try to run it in Access 2000 is that it''s a "Type
conversion failure"

The SQL Statement is:
INSERT INTO
Personal(FName,LName,PreferredName,DayPhone,Evenin gPhone,ContactTime,Email,F
irstBase,Gift1,Gift2,Gift3,babies)VALUES
(''test'','''','''','''','''','''','''','''','''','''','''',''1'')

All the fields you see there, with the exception of the last one, are text
fields. Users can manually type whatever they want in the web form. In the
database, they are mostly defined as text, and one or two are datetime.

The last one is a checkbox (I have more, but commented out for now until I
get this one working). I had the checkbox set to a value of "Yes", and I
got these same errors, so I posted a question at this forum. It was
explained to me that Access needs to have a 1 or 0 passed to fields defined
as yes/no. I tried this, as you can from the above SQL insert statement,
and I''m getting the same error. I even tried "ON", and it didn''t work.

All fields in this statement are defined as not required, and the statement
works fine when that last field isn''t included.

I''m baffled. Can you help?

Disclaimer: I''m used to SQL Server, but this church site project has to be
done in Access.

推荐答案

" middletree"写道......
"middletree" wrote ...
(''test'','''','''','''','''',''''''' '',''','''','''','''',''1'')
我很困惑。你能帮忙吗?
(''test'','''','''','''','''','''','''','''','''','''','''',''1'') I''m baffled. Can you help?




尝试''真''而不是1,如果没有,请你发布确切的

错误消息你正在......以及你正在使用的代码值等等

(使用response.write)


Rob



Try ''true'' instead of the 1, failing that can you please post the exact
error message you are getting...and the code you are using with values etc
(use a response.write)

Rob


不,使用1而不是''1'。我建议永远不要使用真/假。


Ray在家里


Rob Meade < RO ******** @ NO-SPAM.kingswoodweb.net>在消息中写道

新闻:Vh ********************* @ news-text.cableinet.net ...
No, use 1 instead of ''1''. I suggest never using true/false.

Ray at home

"Rob Meade" <ro********@NO-SPAM.kingswoodweb.net> wrote in message
news:Vh*********************@news-text.cableinet.net...
middletree写道......
"middletree" wrote ...
(''test'','''','''','''','''',''''''' '',''','''','''','''',''1'')
(''test'','''','''','''','''','''','''','''','''','''','''',''1'')


我很困惑。你可以帮忙吗?
I''m baffled. Can you help?



试试''true''而不是1,如果没有,你可以发布你得到的确切
错误信息......和代码你正在使用价值观等
(使用response.write)

Rob



Try ''true'' instead of the 1, failing that can you please post the exact
error message you are getting...and the code you are using with values etc
(use a response.write)

Rob



On星期六,2003年11月8日17:31:34 -0500,Ray at<%= sLocation%>

< myfirstname at lane 34。 KOMM>写道:
On Sat, 8 Nov 2003 17:31:34 -0500, "Ray at <%=sLocation%>"
<myfirstname at lane 34 . komm> wrote:
不,使用1而不是''1''。我建议永远不要使用真/假。

雷在家


为什么不呢?在Access中,这是正在使用的值,加上一个

布尔值比数值1或0更容易使用(或者是

,即-1并且0 ??)。

Rob Meade < RO ******** @ NO-SPAM.kingswoodweb.net>在消息中写道
新闻:Vh ********************* @ news-text.cableinet.net ...
No, use 1 instead of ''1''. I suggest never using true/false.

Ray at home
Why not? In Access, this is the value that is being used, plus a
boolean is easier to work with than a numeric value of 1 or 0 (or is
that -1 and 0??).

"Rob Meade" <ro********@NO-SPAM.kingswoodweb.net> wrote in message
news:Vh*********************@news-text.cableinet.net...
" middletree"写道......
"middletree" wrote ...
> (''测试'','''','''','''','''','''','''','''','''',''' ','''',''1'')
> (''test'','''','''','''','''','''','''','''','''','''','''',''1'')


>我很困惑。你可以帮忙吗?
> I''m baffled. Can you help?



试试''true''而不是1,如果没有,你可以发布你得到的确切
错误信息......和代码你正在使用价值观等
(使用response.write)

Rob



Try ''true'' instead of the 1, failing that can you please post the exact
error message you are getting...and the code you are using with values etc
(use a response.write)

Rob






这篇关于Access中的是/否的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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