Re: Access bool integer solution

From: Sim Zacks <sim(at)compulab(dot)co(dot)il>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Access bool integer solution
Date: 2005-12-20 06:13:47
Message-ID: do87h5$imh$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

There are 3 bool possibilities in the ODBC driver
1) bools as char
2) true = -1
3) default (whatever that is, neither option is chosen)

When it is the default (my current setting) or (True =-1 and not bools
as char), then Access recognizes the data type as Yes/No. However, if
you do a comparison in any query you get the operator does not exist
error, unless you use the cbool function to convert the field that
access recognizes as a bool but considers an integer, from an integer to
a real bool.

When bools as char is chosen and not true=-1 then access sees it as a
single character and you cannot click on a checkbox because Access tries
to put in a -1 which is 2 characters. However, queries work without any
extra functions.

When bools as char and True=-1 are chosen then Access see it as a 2
character field, so it should accept the -1, but it gives an error that
-1 does not fit in the field.

Richard Huxton wrote:
> Sim Zacks wrote:
>> I've been having problems with bools in my Access frontend and
>> PostGreSQL backend. The problem is that Access uses -1 for true and 0
>> for false and when it does a select it uses those numbers instead of
>> the true or false values. PostGreSQL does not have an implicit
>> conversion from int to bool, so it was failing was with an error
>> "Operator does not exist: boolean=integer"
>> I got around this in my queries by using the cbool function, which
>> passed in the actual true or false values. This solution did not work
>> for internal filters, because it internally calls the select statement
>> and does not give an interface to the code.
>
> Are you sure there isn't a setting in the ODBC driver to handle this?
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message kishore mukati 2005-12-20 08:35:56 About Blobs in postgresSQL
Previous Message Jerry LeVan 2005-12-20 01:15:52 ANN: PgBrowse 1.5