From: Jeff Eckermann <jeff_eckermann@yahoo.com>
To: Justin Dahl <justind_lst@ussonet.net>
To: pgsql-odbc@postgresql.org
Subject: Re: Access/Postgresql problem with text fields recognized as memo
Date: Wed, 9 Feb 2005 08:54:26 -0800 (PST)
Message-ID: <20050209165427.87791.qmail@web20824.mail.yahoo.com> (raw)
In-Reply-To: <4209342B.7090607@ussonet.net>
--- Justin Dahl <justind_lst@ussonet.net> wrote:
> I've ran into this problem before and then abandoned
> it out of
> frustration, I'm coming back to it again.
>
> Using Access 2000
> Postgresql 7.3.4
> ODBC driver 7.03.02.00 on WinXP
>
> All tables I create have a unique index called "id"
> that is of type
> "serial".
> Setting "Row Versioning" in odbc driver does not
> make any difference.
>
> If a table is created with 3 columns
>
> id (serial)
> field1 (varchar(255))
> field2 (text)
>
> This table is linked into an access file.
>
> If data is typed in at the table view of the file.
>
> Scenario 1:
> Only a value is filled in for field1.
>
> The information is inserted normally and
> everything is happy and good.
>
> Scenario 2:
> Information is filled in for both field1 and
> field2.
>
> The information is inserted normally and
> everyting is happy and good.
>
> Scenario 3:
> Only a value is filled in for field2.
>
> The information is inserted normally, but all
> fields will display
> #Deleted across them appearing to the user to have
> failed.
My understanding (admittedly limited) is that, after
making an insert, Access will attempt to fetch the
record back again, in order to verify that the insert
worked as expected. Not knowing the primary key value
(because it is an autonumber id), Access uses the
known column values to identify the record that needs
to be fetched back. Since Access cannot compare Memo
values with each other, the action fails where only a
Memo value is available. This will also be fragile
where a field1 value is supplied, unless you are
enforcing uniqueness on that field.
My workaround for this problem was to fetch the
primary key value at the time of data input, i.e. have
the BeforeInsert event trigger code that, if the
primary key is unassigned, will run a "select
nextval()" on the appropriate sequence, and assign the
returned value to the primary key field.
>
>
> Scenario 3 is what is bothering me the most. I have
> done quite a bit of
> testing with this and this only occurs in
> conjunction with fields
> recognized as type "memo" by access.
> Please keep in mine that I have a unique index field
> called "id". The
> same thing occurs wheather "Row Versioning" is
> turned on or off on the
> driver.
>
> I lean towards this being a MSAcess issue, can
> anyone give any input on
> this and how i could correct it? Let me know if more
> info is needed.
>
>
>
>
>
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the
> unregister command
> (send "unregister YourEmailAddressHere" to
> majordomo@postgresql.org)
>
__________________________________
Do you Yahoo!?
The all-new My Yahoo! - Get yours free!
http://my.yahoo.com
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: jeff_eckermann@yahoo.com, justind_lst@ussonet.net
Subject: Re: Access/Postgresql problem with text fields recognized as memo
In-Reply-To: <20050209165427.87791.qmail@web20824.mail.yahoo.com>
References: <4209342B.7090607@ussonet.net> <20050209165427.87791.qmail@web20824.mail.yahoo.com>
* 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