Skip site navigation (1) Skip section navigation (2)

Re: Incorrect import of timestamp fields in MS Access with

From: Edwin Woudt <edwin(at)woudt(dot)nl>
To: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: Incorrect import of timestamp fields in MS Access with
Date: 2002-04-16 11:18:43
Message-ID: 2561921928.1018963122@[10.0.1.4] (view raw or whole thread)
Thread:
Lists: pgsql-odbc
Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp> wrote:

>> After switching from PostgreSQL 7.1.3 to 7.2, I'm having trouble with
>> timestamp fields in ODBC-linked tables in MS Access (both '97 and XP).
>>
>> The problem is that MS Access somehow thinks these are 'Text' fields
>> instead of 'Date/Time' fields. It worked fine when using the 7.1.3
>> server, but not with 7.2 and 7.2.1.
>
> What kind of problem do you have concretely ?

Apologies if I was not clear.

I want MS Access to recognize the timestamp field as a Date/Time field and 
not as a Text field. This has some advantages as access can then handle 
formatting and input itself.

I did some more debugging and found in de psqlodbc log file that in 7.1.3 
the field has type 1184 (PG_TYPE_DATETIME), while in 7.2.x the field has 
type 1114 (PG_TYPE_TIMESTAMP_NO_TMZONE).

This led me to the untested patch below against pgtypes.c version 1.46. I'd 
be willing to test this myself, if only I knew how to build the driver.


Edwin


--- pgtypes.c.orig      Tue Apr 16 13:06:36 2002
+++ pgtypes.c   Tue Apr 16 13:08:25 2002
@@ -311,10 +311,11 @@
 #endif /* ODBCVER */
                        return SQL_TIME;
                case PG_TYPE_ABSTIME:
                case PG_TYPE_DATETIME:
                case PG_TYPE_TIMESTAMP:
+               case PG_TYPE_TIMESTAMP_NO_TMZONE:
 #if (ODBCVER >= 0x0300)
                        if (EN_is_odbc3(env))
                                return SQL_TYPE_TIMESTAMP;
 #endif /* ODBCVER */
                        return SQL_TIMESTAMP;



In response to

Responses

pgsql-odbc by date

Next:From: Miguel A. JuanDate: 2002-04-16 12:01:49
Subject: New version of ODBC
Previous:From: Hiroshi InoueDate: 2002-04-16 11:07:12
Subject: Re: Incorrect import of timestamp fields in MS Access with 7.2.x

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group