pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Postgres ODBC and SQL_BIT
3+ messages / 3 participants
[nested] [flat]

* Postgres ODBC and SQL_BIT
@ 1998-09-02 11:30  leif@danmos.dk
  0 siblings, 1 reply; 3+ messages in thread

From: leif@danmos.dk @ 1998-09-02 11:30 UTC (permalink / raw)
  To: pgsql-interfaces


  Hi all,

   Excuse me for a newbie question.

   I am trying to make a PostgreSQL database that must be compatible with
an existing M$Access database. I have some trouble figuring out what
postgres type to use for SQL_BIT. I believe the Access type is called Yes/No
(and is used for checkboxes.) I am also using this in a C/C++ program using
ODBC. My C/C++ program correctly connects to an Access database with these
fields, and I have tried both 'bool' and 'char' as types in the Postgres
database, but none of them works. Is there a standard type for this or do
I have to make my own (and if so, how?) ?


    Thanks in advance,

___________________________________________________________________________
                                             /
       _/                            _/_/   /  Leif Jensen (leif@danmos.dk)
      _/                _/         _/      /
     _/        _/_/             _/_/_/    /
    _/       _/   _/   _/        _/      / Linux 2.0.33, gcc 2.7.2, wxWin 1.68c
   _/       _/ _/_/   _/        _/      /
  _/       _/        _/   _/   _/      /
 _/_/_/_/   _/_/      _/_/    _/      /         (and Windows 95 :-(
___________________________________________________________________________




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [INTERFACES] Postgres ODBC and SQL_BIT
@ 1998-09-02 16:59  David Hartwig <daveh@insightdist.com>
  parent: leif@danmos.dk
  0 siblings, 1 reply; 3+ messages in thread

From: David Hartwig @ 1998-09-02 16:59 UTC (permalink / raw)
  To: leif@danmos.dk; +Cc: pgsql-interfaces



leif@danmos.dk wrote:

>   Hi all,
>
>    Excuse me for a newbie question.
>
>    I am trying to make a PostgreSQL database that must be compatible with
> an existing M$Access database. I have some trouble figuring out what
> postgres type to use for SQL_BIT. I believe the Access type is called Yes/No
> (and is used for checkboxes.) I am also using this in a C/C++ program using
> ODBC. My C/C++ program correctly connects to an Access database with these
> fields, and I have tried both 'bool' and 'char' as types in the Postgres
> database, but none of them works. Is there a standard type for this or do
> I have to make my own (and if so, how?) ?

MS Access will not take any ODBC SQL data type and translate it into a check box.
Other tool may do this but not MS Access.   Access only supports check boxes on
Access databases.

As for what Access it will do - The psqlodbc driver as options to treat postgresql
bools as SQL_CHAR (t/f) or or SQL_BIT.  MS Access displays SQL_BIT as -1/0.

If you are not using the psqlodbc driver, you are on your own.




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [INTERFACES] Postgres ODBC and SQL_BIT
@ 1998-09-03 06:34  Olaf Mittelstaedt <mstaedt@va-sigi.va.fh-ulm.de>
  parent: David Hartwig <daveh@insightdist.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Olaf Mittelstaedt @ 1998-09-03 06:34 UTC (permalink / raw)
  To: pgsql-interfaces; +Cc: pgsql-interfaces

> MS Access will not take any ODBC SQL data type and translate it into a check box.
> Other tool may do this but not MS Access.   Access only supports check boxes on
> Access databases.
> 
> As for what Access it will do - The psqlodbc driver as options to treat postgresql
> bools as SQL_CHAR (t/f) or or SQL_BIT.  MS Access displays SQL_BIT as -1/0.

When migrating a database from native Access to Postgres I replaced
Boolean with Integers (0=false, -1=true), I had no problems to use 
checkboxes connected with those fields.

Regards,
Olaf
--
Olaf Mittelstaedt - IuK - mittelstaedt@fh-ulm.de
Fachhochschule Ulm  Prittwitzstr. 10   89075 Ulm
Tel.: +49 (0)731-502-8220             Fax: -8270

 Ash nazg durbatulûk, ash nazg gimbatul,
  ash nazg thrakatulûk agh burzum-ishi krimpatul.




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~1998-09-03 06:34 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-09-02 11:30 Postgres ODBC and SQL_BIT leif@danmos.dk
1998-09-02 16:59 ` David Hartwig <daveh@insightdist.com>
1998-09-03 06:34   ` Olaf Mittelstaedt <mstaedt@va-sigi.va.fh-ulm.de>

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