pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Bolen <db3l.net@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: Domains, casts, and MS Access
Date: Thu, 05 Aug 2010 17:28:13 -0400
Message-ID: <m2y6ckoiky.fsf@valheru.db3l.homeip.net> (raw)
References: <AANLkTi=3HQborwBRTMfiPtKDFzRzQLtkHJ-E=m31vkUT@mail.gmail.com>
	<AANLkTim5LFi2pGHoVOhyscWDxpvRUEZdGQ0vxMkOEppT@mail.gmail.com>
	<AANLkTimP3GxKof7_r7VrpjWJRM1HjUC11RnHKyyiyS4A@mail.gmail.com>
	<AANLkTimDr=5+jUOZ0XuGDYm4wRTj2w9asN18bUU6_a4O@mail.gmail.com>
	<4C59CC8C.1010206@magwerks.com>
	<AANLkTikXPkDmRYjk05-64pk-sTjc1w=nNGB+WjCm9nOr@mail.gmail.com>
	<AANLkTi=5kNA8mBx=V+9yOLQYRFPDL6_5SNjFpFzswu0v@mail.gmail.com>

Peter Koczan <pjkoczan@gmail.com> writes:

> On Wed, Aug 4, 2010 at 4:40 PM, Richard Broersma
> <richard.broersma@gmail.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




view thread (10+ messages)  latest in thread

Message-ID: <m2y6ckoiky.fsf@valheru.db3l.homeip.net>
Permalink:  ../m2y6ckoiky.fsf@valheru.db3l.homeip.net/
Also on:    postgresql.org/message-id/m2y6ckoiky.fsf@valheru.db3l.homeip.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: db3l.net@gmail.com
  Subject: Re: Domains, casts, and MS Access
  In-Reply-To: <m2y6ckoiky.fsf@valheru.db3l.homeip.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox