X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 35148329C6B for ; Mon, 27 Sep 2004 22:15:20 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 44841-10 for ; Mon, 27 Sep 2004 21:15:16 +0000 (GMT) Received: from gk-us2.michelin.com (gk-us2.michelin.com [156.65.14.19]) by svr1.postgresql.org (Postfix) with ESMTP id 7D0B232A01E for ; Mon, 27 Sep 2004 22:15:17 +0100 (BST) Received: from ONCMH1.onc.michelin.com (unverified) by gk-us2.michelin.com (Content Technologies SMTPRS 4.3.10) with ESMTP id for ; Mon, 27 Sep 2004 17:08:09 -0400 Received: from oncmtap1.onc.michelin.com by oncmh1.onc.michelin.com with ESMTP for pgsql-odbc@postgresql.org; Mon, 27 Sep 2004 17:10:24 -0400 Received: from oncems01.onc.michelin.com ([156.65.125.150]) by oncmtap1.onc.michelin.com (Netscape Messaging Server 4.15) with ESMTP id I4PXOT00.UM5 for ; Mon, 27 Sep 2004 17:14:53 -0400 Received: from us.michelin.com (unverified) by oncems01.onc.michelin.com (Content Technologies SMTPRS 4.2.5) with ESMTP id for ; Mon, 27 Sep 2004 17:14:53 -0400 Message-Id: <415882CB.3000900@us.michelin.com> Date: Mon, 27 Sep 2004 17:14:51 -0400 From: "Greg Campbell" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-odbc@postgresql.org Subject: Re: basic questions with odbc and visual basic. References: <41588ED6.19566.3EA7F9AB@localhost> In-Reply-To: <41588ED6.19566.3EA7F9AB@localhost> Content-Type: multipart/mixed; boundary="------------000402080806040002050201" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_RFCI X-Spam-Level: X-Archive-Number: 200409/79 X-Sequence-Number: 4454 This is a multi-part message in MIME format. --------------000402080806040002050201 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit The traditional hack for faking a unique key is to add a timestamp column to the database table in question-- unique indexed - with a default timestamp of Now(). Gary Doades wrote: >On 27 Sep 2004 at 16:42, Merlin Moncure wrote: > > > >>>For manipulating the data -- Access works pretty good as long as >>> >>> >>Access >> >> >>>can know which record(s) to update (primary keys or OIDs -- that sort >>> >>> >>of >> >> >>>thing). >>> >>> >> >> >>Looking deeper it seems all my problems are really boiling down to one >>problem: the where clause used to update the edited record back to the >>server. Both access and vb generate a where clause that includes every >>field in the table instead of the p-key. For various sundry reasons >>such as improper handling of null values, etc. this where clause gets >>busted. This problem is aggravated by the fact that all my domains get >>treated as text types, although this is correctable by using a view >>which I was planning to use anyways (aside: I make heavy use of >>domains). This busted where clause trips up vb and access in different >>ways. This may be a case where I may want to explore hacking the odbc >>driver to get it to do what I want, depending on who is building the >>clause. My guess is the ado driver is building it so I'm basically >>hosed. It's really queer to me that they use the p-key to pull the data >>out and the entire record to write the data back...what's the point of >>the p-key anyways? >> >>The odbc driver is supposed to have a property exposed to the ado >>wrapper that allows you to constrain the write-back where clause to >>different things, but apparently this does not work in pgsql-odbc. >> >>I tried the ole db driver and got nowhere, couldn't even get a basic >>connection. Hopefully I can get this corrected and work with this >>driver a little bit. I have about two weeks to figure out the best way >>to proceed. So far, I'm really unimpressed with the ado architecture, >>this being my first real experience with it (as compared to ado.net, >>which is a dream to work with). >> >> >> > >The only reason the ADO driver would build an update statement using >all columns is that it can't identify a unique key (primary key). It's >possible that the ODBC driver does not correctly supply this info. > >Can you do something artificial like put an additional unique index on >the primary key? > >As a last resort you might try a commercial ODBC driver for postgres >,openlink I think for one, to see if this helps. At least it may give pointers >to the real problem. ( you can get a trial copy for a while I think) > >Cheers, >Gary. > > >---------------------------(end of broadcast)--------------------------- >TIP 4: Don't 'kill -9' the postmaster > > --------------000402080806040002050201 Content-Type: text/x-vcard; charset=utf8; name="greg.campbell.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="greg.campbell.vcf" begin:vcard fn:Greg Campbell n:Campbell;Greg org:Michelin North America;ENG-IT adr;dom:;;2420 Two Notch Road;Lexington;SC;29071 email;internet:greg.campbell@us.michelin.com title:Systems Engineer tel;work:803-951-5561 tel;fax:803-951-5531 x-mozilla-html:FALSE version:2.1 end:vcard --------------000402080806040002050201--