Re: Domains, casts, and MS Access

From: David Bolen <db3l(dot)net(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Domains, casts, and MS Access
Date: 2010-08-05 21:28:13
Message-ID: m2y6ckoiky.fsf@valheru.db3l.homeip.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Peter Koczan <pjkoczan(at)gmail(dot)com> writes:

> On Wed, Aug 4, 2010 at 4:40 PM, Richard Broersma
> <richard(dot)broersma(at)gmail(dot)com> wrote:
(...)
>> I know that there is a setting in the ODBC driver for true = -1 but it
>> doesn't work well.  I also remember that filters didn't work on mapped
>> boolean columns.
>
> Yep, that's the stumbling block we're running into. ODBC and these
> fields' assumptions of true/false are at odds. I'm trying a few other
> things with casts in the meantime to see if they'll work.

I'm still supporting a legacy Access front-end that I converted over
to PostgreSQL a few years back, and did have to do some work for
boolean fields. It's been a while, but I believe I:

* Disabled the ODBC driver option "Bools as Char"
* Did not enable the "True=-1" option in the driver
* Ensured that no boolean fields were nullable (otherwise in a query
that Access uses to determine if a record changed prior to posting its
own changes the NULL value would become False by the time it reached
Access, and Access would then fail to post changes believing the row had
already been edited).
* Added a series of functions for integer/boolean comparisons, so
filters and queries would work.

Outside of boolean support, I also needed to add a "lo" domain to work with
some fields across the interface (I think text fields that were memo on the
Access side, but it's been a while).

I think this page was the most helpful overall in identifying the most
stuff in one place while I was getting things set up. My
boolean/integer comparison functions are also from this page:

http://www.postgresonline.com/journal/archives/24-Using-MS-Access-with-PostgreSQL.html

Note that it recommends enabling the True=-1 option in the driver, but I don't
appear to be running with that, so either it didn't make a difference, or it
caused me problems, I can't be remember.

But with the above, I'm not having any problems with Access working against
the database, including using the boolean fields in filters or queries.

-- David

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Marc Mamin 2010-08-06 12:19:49 Re: workaround for missing ROWNUM feature with the help of GUC variables
Previous Message Richard Broersma 2010-08-05 01:49:05 Re: Domains, casts, and MS Access