From kbailey@freewayprojects.com Wed Sep 27 22:22:05 2006 Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 3A8539FB30E for ; Wed, 27 Sep 2006 19:22:05 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 89291-03 for ; Wed, 27 Sep 2006 22:21:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tailorone.freewayprojects.com (tailorone.freewayprojects.com [212.84.168.98]) by postgresql.org (Postfix) with ESMTP id 8BE4D9FB2DE for ; Wed, 27 Sep 2006 19:21:59 -0300 (ADT) Received: from [10.130.1.25] (southviewterrace.demon.co.uk [::ffff:80.177.110.211]) (AUTH: LOGIN kbailey@freewayprojects.com) by tailorone.freewayprojects.com with esmtp; Wed, 27 Sep 2006 23:21:57 +0100 id 0001434D.451AF985.00005EFC Message-ID: <451AF984.1010605@freewayprojects.com> Date: Wed, 27 Sep 2006 23:21:56 +0100 From: Kevin Bailey User-Agent: Debian Thunderbird 1.0.2 (X11/20060724) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-odbc@postgresql.org Subject: Simple way of storing Access booleans (Yes/No) fields Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.216 tagged_above=0 required=5 tests=HTML_MESSAGE, HTML_TITLE_EMPTY, MIME_HTML_ONLY X-Spam-Level: X-Archive-Number: 200609/101 X-Sequence-Number: 8252 Hi,

PG version 7.4 and Access version 2003.

Its the old Access boolean issue which needs as simple an answer as possible?


I have a client where many users were running off the same Access database which obviously got corrupted and recently failed completely.

After finding a backup the data has been moved to a Postgresql DB running on a Debian stable server.

The data was exported via ODBC and I've tidied up the autonumber-to-sequence issue.  The original Access tables were renamed to tablebnname_old and the new Postgresql tables have been set up as linked tables with the original names.  Most of the application is working fine.

Seems like only one issue remains.

On a couple of forms there are check boxes and radio buttons which linked originally to Yes/No (i.e. Boolean) fields in the original Access table.

I have a fairly free hand to sort this out - and there are only 4 tables which contain boolean fields and I can alter the Access application as I see fit.

There are quite a few queries (dozens) but again I can ask them to cut them down and re-write needed queries if necessary.

What is the simplest way forward?

What should the ODBC connection be set as?

Here are some possible scenarios.

1. Should I set the fields to be int2 data type and then set the ODBC driver to not treat bools as char but treat -1 as true. 

Will queries written in Access then run correctly?  I thought I'd tried this and it didn't work possibly because I did not relink the table.

2. If I simply uncheck the treat bools as char option will the data be saved correctly as booleans - will the ODBC driver be ok with the data - i.e. reading and writing.

3. Should I simply set the field as a char(1) and then in Access somehow or other set the check boxes to save the data as 't' or 'f'.  How would the control do with reading the data.

4. I understand there may be some extra functions which may be added to PG to get Access play properly - is there a simple function which can be added.  Is there a well documented, proven and established method to acheive this.

5. Have these methods been 'tried and tested'

http://www.mail-archive.com/pgsql-docs@postgresql.org/msg01563.html
http://community.seattleserver.com/viewtopic.php?p=8&sid=3add118a6924da03531fcbbbcc2c3ca8
http://www.mrayyan.com/?p=42

6. Change the check boxes to combo boxes - the form is horribly cluttered but the following seems like a simple answer.

The way I have handled this is to avoid check boxes and use a combo box 
instead. I supply the values as True;1 ,False;0 and bind the field to the 
second value of each pair. To make things easier for data entry I hide the 
second column by giving it a width of 0".  In my DSN settings I check bool as 
char and uncheck true as -1. 
-- 
Adrian Klaver	


aklaver ( at ) comcast ( dot ) net

There are however dozens of queries and many of them use booleans which then may not work - however, if needed I can ask the client to remove the unneeded queries and I could then re-write the existing queries to take into account the new field.

Maybe I should create the field as int2 and in the combo box have the bound fields as -1 (label True) and 0 (label False).  Maybe this way the existing Access queries would work ok without changes?




Any thoughts would be gratefully received.

Kevin
From philippe.lang@attiksystem.ch Thu Sep 28 06:48:36 2006 Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 773C19FB2B6 for ; Thu, 28 Sep 2006 03:48:36 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 86006-02 for ; Thu, 28 Sep 2006 06:48:27 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.attiksystem.ch (f29.attiksystem.ch [212.147.59.29]) by postgresql.org (Postfix) with ESMTP id D07FA9FB28D for ; Thu, 28 Sep 2006 03:48:26 -0300 (ADT) Received: from poweredge.attiksystem.ch (poweredge.attiksystem.ch [10.0.0.29]) by mail.attiksystem.ch (8.12.11/8.12.11) with ESMTP id k8S6mMbA076573; Thu, 28 Sep 2006 08:48:23 +0200 (CEST) (envelope-from philippe.lang@attiksystem.ch) Subject: Re: Simple way of storing Access booleans (Yes/No) fields MIME-Version: 1.0 Content-Type: multipart/signed; micalg=SHA1; protocol="application/x-pkcs7-signature"; boundary="----=_NextPart_000_0004_01C6E2DA.DA811B80" Date: Thu, 28 Sep 2006 08:48:22 +0200 Content-class: urn:content-classes:message x-mimeole: Produced By Microsoft Exchange V6.0.6603.0 Message-ID: <6C0CF58A187DA5479245E0830AF84F421D12D2@poweredge.attiksystem.ch> X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: [ODBC] Simple way of storing Access booleans (Yes/No) fields Thread-Index: Acbig2D4HMU5y/I4SpCm8980FshgkwARql8A From: "Philippe Lang" To: "Kevin Bailey" , X-Scanned-By: MIMEDefang 2.49 on 10.0.0.111 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.134 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, SPF_PASS X-Spam-Level: X-Archive-Number: 200609/102 X-Sequence-Number: 8253 This is a multi-part message in MIME format. ------=_NextPart_000_0004_01C6E2DA.DA811B80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, Firstly, don't forget to use an Access 2003 native format database in = your project, and not an Access 2000 format database. There are huge = slowups when using the Access 2000 format. Don't ask me why! For your specific problem, I would personnaly use an int2, and treat on = the server everything that is different from 0 as true. This is quick, = and with a little work in PLPGSQL, it might be clean too. Otherwise, you = might give a try to the advanced options of the ODBC driver: I'm not = sure they can help, but it's worth trying. Regards, --------------- Philippe Lang ________________________________ De : pgsql-odbc-owner@postgresql.org = [mailto:pgsql-odbc-owner@postgresql.org] De la part de Kevin Bailey Envoy=E9 : jeudi, 28. septembre 2006 00:22 =C0 : pgsql-odbc@postgresql.org Objet : [ODBC] Simple way of storing Access booleans (Yes/No) fields =09 =09 Hi, =09 PG version 7.4 and Access version 2003. =09 Its the old Access boolean issue which needs as simple an answer as = possible? =09 =09 I have a client where many users were running off the same Access = database which obviously got corrupted and recently failed completely. =09 After finding a backup the data has been moved to a Postgresql DB = running on a Debian stable server. =09 The data was exported via ODBC and I've tidied up the = autonumber-to-sequence issue. The original Access tables were renamed = to tablebnname_old and the new Postgresql tables have been set up as = linked tables with the original names. Most of the application is = working fine. =09 Seems like only one issue remains. =09 On a couple of forms there are check boxes and radio buttons which = linked originally to Yes/No (i.e. Boolean) fields in the original Access = table. =09 I have a fairly free hand to sort this out - and there are only 4 = tables which contain boolean fields and I can alter the Access = application as I see fit. =09 There are quite a few queries (dozens) but again I can ask them to cut = them down and re-write needed queries if necessary. =09 What is the simplest way forward? =09 What should the ODBC connection be set as? =09 Here are some possible scenarios. =09 1. Should I set the fields to be int2 data type and then set the ODBC = driver to not treat bools as char but treat -1 as true. =20 =09 Will queries written in Access then run correctly? I thought I'd tried = this and it didn't work possibly because I did not relink the table. =09 2. If I simply uncheck the treat bools as char option will the data be = saved correctly as booleans - will the ODBC driver be ok with the data - = i.e. reading and writing. =09 3. Should I simply set the field as a char(1) and then in Access = somehow or other set the check boxes to save the data as 't' or 'f'. = How would the control do with reading the data. =09 4. I understand there may be some extra functions which may be added to = PG to get Access play properly - is there a simple function which can be = added. Is there a well documented, proven and established method to = acheive this. =09 5. Have these methods been 'tried and tested' =09 http://www.mail-archive.com/pgsql-docs@postgresql.org/msg01563.html = http://community.seattleserver.com/viewtopic.php?p=3D8&sid=3D3add118a6924= da03531fcbbbcc2c3ca8 http://www.mrayyan.com/?p=3D42 =09 6. Change the check boxes to combo boxes - the form is horribly = cluttered but the following seems like a simple answer. =09 =09 The way I have handled this is to avoid check boxes and use a combo box = instead. I supply the values as True;1 ,False;0 and bind the field to = the=20 second value of each pair. To make things easier for data entry I hide = the=20 second column by giving it a width of 0". In my DSN settings I check = bool as=20 char and uncheck true as -1.=20 --=20 Adrian Klaver=09 =09 =09 aklaver ( at ) comcast ( dot ) net There are however dozens of queries and many of them use booleans which = then may not work - however, if needed I can ask the client to remove = the unneeded queries and I could then re-write the existing queries to = take into account the new field. =09 Maybe I should create the field as int2 and in the combo box have the = bound fields as -1 (label True) and 0 (label False). Maybe this way the = existing Access queries would work ok without changes? =09 =09 =09 =09 Any thoughts would be gratefully received. =09 Kevin =09 ------=_NextPart_000_0004_01C6E2DA.DA811B80 Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIII/zCCAocw ggHwoAMCAQICEEdYYafa1wkm0CP4DOffAiswDQYJKoZIhvcNAQEEBQAwYjELMAkGA1UEBhMCWkEx JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQ ZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA2MDYyMjE3MzE0NloXDTA3MDYyMjE3MzE0 NlowZzENMAsGA1UEBBMETGFuZzERMA8GA1UEKhMIUGhpbGlwcGUxFjAUBgNVBAMTDVBoaWxpcHBl IExhbmcxKzApBgkqhkiG9w0BCQEWHHBoaWxpcHBlLmxhbmdAYXR0aWtzeXN0ZW0uY2gwgZ8wDQYJ KoZIhvcNAQEBBQADgY0AMIGJAoGBAOfvCPREDwfIbzsNRoyBDo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HkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQZXJz b25hbCBGcmVlbWFpbCBJc3N1aW5nIENBAhBHWGGn2tcJJtAj+Azn3wIrMIGHBgsqhkiG9w0BCRAC CzF4oHYwYjELMAkGA1UEBhMCWkExJTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0 ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBAhBHWGGn2tcJ JtAj+Azn3wIrMA0GCSqGSIb3DQEBAQUABIGAHLbnyQo4sfHGiMEefu3PhuzQxKvhGsfgIWLHyqrc /GvH1RnUBNqDksxQjcrCF4aVN06RMTP4D9DA1wc5jlYfXoOlhiUA5wKc/ef/XN+MaujuyAQgfra8 haMJv7NADoYuRzR9S6Uqs6aunfZCWo+EHhc+t7x/rQXiBV6N7ihTl60AAAAAAAA= ------=_NextPart_000_0004_01C6E2DA.DA811B80-- From sim@compulab.co.il Thu Sep 28 08:40:15 2006 Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 28A559FA47B for ; Thu, 28 Sep 2006 05:40:15 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 96768-04 for ; Thu, 28 Sep 2006 05:40:10 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.linux-boards.com (mail.linux-boards.com [62.90.235.247]) by postgresql.org (Postfix) with ESMTP id B05D79FA433 for ; Thu, 28 Sep 2006 05:39:56 -0300 (ADT) Received: from sim (sim [10.1.1.27]) by mail.linux-boards.com (8.12.5/8.12.8) with ESMTP id k8S8SG00004792; Thu, 28 Sep 2006 11:28:26 +0300 Date: Thu, 28 Sep 2006 11:35:28 +0200 From: Sim Zacks X-Mailer: The Bat! (v1.62r) Business Reply-To: Sim Zacks Organization: CompuLab X-Priority: 3 (Normal) Message-ID: <439449966.20060928113528@compulab.co.il> To: Kevin Bailey CC: pgsql-odbc@postgresql.org Subject: Re: Simple way of storing Access booleans (Yes/No) fields In-Reply-To: <451AF984.1010605@freewayprojects.com> References: <451AF984.1010605@freewayprojects.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.04 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200609/104 X-Sequence-Number: 8255 In Postgresql 8.0 I wrote the following functions, which will probably work in 7.4 as well. They have removed the bool problem completely. My ODBC settings are: Bools as Char UNCHECKED TRUE is -1 UNCHECKED I am using Access 2000, with a lot of checkboxes and boolean fields in the front end with no problems Sim set search_path=pg_catalog; create or replace function inttobool(num int,val bool) returns bool as $$ begin if num=0 and not val then return true; elsif num<>0 and val then return true; else return false; end if; end; $$ language 'plpgsql'; create or replace function inttobool(val bool, num int) returns bool as $$ begin return inttobool(num,val); end; $$ language 'plpgsql'; create or replace function notinttobool(val bool, num int) returns bool as $$ begin return not inttobool(num,val); end; $$ language 'plpgsql'; create or replace function notinttobool(num int, val bool) returns bool as $$ begin return not inttobool(num,val); end; $$ language 'plpgsql'; CREATE OPERATOR = ( leftarg = integer, rightarg = boolean, procedure = inttobool, commutator = =, negator = != ); CREATE OPERATOR = ( leftarg = boolean, rightarg = integer, procedure = inttobool, commutator = =, negator = != ); CREATE OPERATOR <> ( leftarg = integer, rightarg = boolean, procedure = notinttobool, commutator = <>, negator = = ); CREATE OPERATOR <> ( leftarg = boolean, rightarg = integer, procedure = notinttobool, commutator = <>, negator = = ); ________________________________________________________________________________ Hi, PG version 7.4 and Access version 2003. Its the old Access boolean issue which needs as simple an answer as possible? I have a client where many users were running off the same Access database which obviously got corrupted and recently failed completely. After finding a backup the data has been moved to a Postgresql DB running on a Debian stable server. The data was exported via ODBC and I've tidied up the autonumber-to-sequence issue.  The original Access tables were renamed to tablebnname_old and the new Postgresql tables have been set up as linked tables with the original names.  Most of the application is working fine. Seems like only one issue remains. On a couple of forms there are check boxes and radio buttons which linked originally to Yes/No (i.e. Boolean) fields in the original Access table. I have a fairly free hand to sort this out - and there are only 4 tables which contain boolean fields and I can alter the Access application as I see fit. There are quite a few queries (dozens) but again I can ask them to cut them down and re-write needed queries if necessary. What is the simplest way forward? What should the ODBC connection be set as? Here are some possible scenarios. 1. Should I set the fields to be int2 data type and then set the ODBC driver to not treat bools as char but treat -1 as true.  Will queries written in Access then run correctly?  I thought I'd tried this and it didn't work possibly because I did not relink the table. 2. If I simply uncheck the treat bools as char option will the data be saved correctly as booleans - will the ODBC driver be ok with the data - i.e. reading and writing. 3. Should I simply set the field as a char(1) and then in Access somehow or other set the check boxes to save the data as 't' or 'f'.  How would the control do with reading the data. 4. I understand there may be some extra functions which may be added to PG to get Access play properly - is there a simple function which can be added.  Is there a well documented, proven and established method to acheive this. 5. Have these methods been 'tried and tested' http://www.mail-archive.com/pgsql-docs@postgresql.org/msg01563.html http://community.seattleserver.com/viewtopic.php?p=8 sid=3add118a6924da03531fcbbbcc2c3ca8 http://www.mrayyan.com/?p=42 6. Change the check boxes to combo boxes - the form is horribly cluttered but the following seems like a simple answer. The way I have handled this is to avoid check boxes and use a combo box instead. I supply the values as True;1 ,False;0 and bind the field to the second value of each pair. To make things easier for data entry I hide the second column by giving it a width of 0". In my DSN settings I check bool as char and uncheck true as -1. -- Adrian Klaver aklaver ( at ) comcast ( dot ) net There are however dozens of queries and many of them use booleans which then may not work - however, if needed I can ask the client to remove the unneeded queries and I could then re-write the existing queries to take into account the new field. Maybe I should create the field as int2 and in the combo box have the bound fields as -1 (label True) and 0 (label False).  Maybe this way the existing Access queries would work ok without changes? Any thoughts would be gratefully received. Kevin