什么时候布尔值不是布尔值? [英] When is a boolean not a boolean?

查看:118
本文介绍了什么时候布尔值不是布尔值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的问题,就是让我挠头。


该应用程序是用AccessXP编写的。该表是FoxPro 2.6表。我

通过ODBC链接到它。在FoxPro中有一个名为Active的字段,类型为Logical

(布尔值)。


我有一个查询,我选择OrderID和Active。它提供

记录罚款。


如果我输入False或True作为Active的标准,则没有记录

返回。


如果我创建一个像

Expr1的表达式:[Active] = 0



Expr1:[Active] = -1

该列中的结果为0或-1,具体取决于是否
Active是真或假,如我所料。然而,如果我在表达式的'Criteria行中输入True或

False,则不会返回任何记录。


这是ODBC问题吗?虽然0或-1似乎是数字是

它可能会将Active的值视为字符串或双倍或

其他一些东西?


让我感到困惑的是它在A97中运行正常....但A97并没有使用

ODBC for FoxPro表...它使用了一些Isam驱动程序。


你对调试这个功能有什么建议吗?

I have a strange one that''s making me scratch my head.

The app is written in AccessXP. The table is a FoxPro 2.6 table. I
link to it via ODBC. There is a field called Active, type Logical
(boolean) in FoxPro.

I have a query where I select OrderID and Active. It presents the
records fine.

If I enter False or True for the criteria of Active, no records are
returned.

If I create an expression like
Expr1:[Active] = 0
or
Expr1:[Active] = -1
the results in that column are 0 or -1 depending on whether or not
Active is true or false as I would expect. Yet if I put in True or
False in the expression''s Criteria row no records are returned.

Is this an ODBC problem? Although the 0 or -1 appear to be numbers is
it possible it considers the value of Active as a string or a double or
some other thing?

What confounds me is that it works fine in A97....but A97 doesn''t use
the ODBC for FoxPro tables...it uses some Isam drivers.

Do you have any suggestions for debugging this "feature"?

推荐答案

沙拉,不知道你的问题的答案,但你有没有尝试使用0

或-1作为查询的标准?只是想知道!


-

Reggie


----------

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

新闻:W _ ****************** @ newsread2.news.pas.earth link.net ...
Salad, Don''t know the answer to your question, but have you tried using 0
or -1 as the criteria in the query? Just wondering!

--
Reggie

----------
"Salad" <oi*@vinegar.com> wrote in message
news:W_******************@newsread2.news.pas.earth link.net...
我有一个奇怪的问题,就是让我挠头。

该应用程序是用AccessXP编写的。该表是FoxPro 2.6表。我通过ODBC链接到它。在FoxPro中有一个名为Active的字段,类型为Logical
(boolean)。

我有一个查询,我选择OrderID和Active。它提供了很好的
记录。

如果我输入False或True作为Active的标准,则不会返回任何记录。

如果我创建表达式如
Expr1:[Active] = 0

Expr1:[Active] = -1
该列中的结果为0或-1,具体取决于是否
正如我所料,活跃是真是假。然而,如果我在表达式的'Criteria行中输入True或
False,则不返回任何记录。

这是ODBC问题吗?虽然0或-1似乎是数字是
它可能会将Active的值视为一个字符串或双倍或
其他一些东西?

让我感到困惑的是它在A97中运行良好....但A97并没有使用ODBC for FoxPro表...它使用了一些Isam驱动程序。

你有任何调试建议吗?这个功能?
I have a strange one that''s making me scratch my head.

The app is written in AccessXP. The table is a FoxPro 2.6 table. I
link to it via ODBC. There is a field called Active, type Logical
(boolean) in FoxPro.

I have a query where I select OrderID and Active. It presents the
records fine.

If I enter False or True for the criteria of Active, no records are
returned.

If I create an expression like
Expr1:[Active] = 0
or
Expr1:[Active] = -1
the results in that column are 0 or -1 depending on whether or not
Active is true or false as I would expect. Yet if I put in True or
False in the expression''s Criteria row no records are returned.

Is this an ODBC problem? Although the 0 or -1 appear to be numbers is
it possible it considers the value of Active as a string or a double or
some other thing?

What confounds me is that it works fine in A97....but A97 doesn''t use
the ODBC for FoxPro tables...it uses some Isam drivers.

Do you have any suggestions for debugging this "feature"?



Reggie写道:
沙拉,不知道你问题的答案,但是您是否尝试过使用0
或-1作为查询中的条件?只是想知道!
Salad, Don''t know the answer to your question, but have you tried using 0
or -1 as the criteria in the query? Just wondering!



是的。我试过了,结果相同。只要我没有WHere

条款,我就会得到记录。如果我尝试过滤True / False或0,-1那么

没有返回记录。


Yes. I tried that, same results. As long as I don''t have a WHere
clause I get records. If I try to filter on True/False or 0,-1 there
are no records returned.


Reggie写道:
Reggie wrote:
沙拉,不知道你的问题的答案,但是你尝试使用0
或-1作为查询的标准吗?只是想知道!
Salad, Don''t know the answer to your question, but have you tried using 0
or -1 as the criteria in the query? Just wondering!




嗯...我输入了

Expr1:CInt([Active])

和在条件行中为True或False,我得到记录。这似乎很奇怪

因为我输入了

Expr2:[Active] = True

并且取决于Active是真还是假我得0或-1

且值正确。



Hmmm...I entered
Expr1 : CInt([Active])
and in the criteria row True or False and I get records. This seems odd
since I have entered
Expr2 : [Active] = True
and depending on whether or not Active is True or False I get 0 or -1
and the values are correct.


这篇关于什么时候布尔值不是布尔值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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