X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 52B2FD1C4EB for ; Sat, 24 Apr 2004 01:35:48 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 05787-09 for ; Sat, 24 Apr 2004 01:35:47 -0300 (ADT) Received: from ganymede.hub.org (u46n208.hfx.eastlink.ca [24.222.46.208]) by svr1.postgresql.org (Postfix) with ESMTP id D943ED1CB1D for ; Sat, 24 Apr 2004 01:35:45 -0300 (ADT) Received: by ganymede.hub.org (Postfix, from userid 1000) id 956FE3460B; Sat, 24 Apr 2004 01:35:45 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by ganymede.hub.org (Postfix) with ESMTP id 946A734605 for ; Sat, 24 Apr 2004 01:35:45 -0300 (ADT) X-Received: from localhost ([unix socket]) by ganymede.hub.org (Cyrus v2.2.3) with LMTP; Wed, 21 Apr 2004 17:20:50 -0300 X-Sieve: CMU Sieve 2.2 X-Received: from localhost (localhost [127.0.0.1]) by ganymede.hub.org (Postfix) with ESMTP id 001E0361C8 for ; Wed, 21 Apr 2004 17:20:43 -0300 (ADT) X-Received: from mail.postgresql.org [200.46.204.71] by localhost with IMAP (fetchmail-6.2.5) for scrappy@localhost (single-drop); Wed, 21 Apr 2004 17:20:44 -0300 (ADT) X-Received: from svr1.postgresql.org ([unix socket]) by svr1.postgresql.org (Cyrus v2.2.3) with LMTP; Wed, 21 Apr 2004 17:17:04 -0300 X-Sieve: CMU Sieve 2.2 X-Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id B1F9DD1D8BF for ; Wed, 21 Apr 2004 17:17:04 -0300 (ADT) X-Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 21038-01 for ; Wed, 21 Apr 2004 17:17:04 -0300 (ADT) X-Received: from web20802.mail.yahoo.com (web20802.mail.yahoo.com [216.136.226.191]) by svr1.postgresql.org (Postfix) with SMTP id C1050D1BAD1 for ; Wed, 21 Apr 2004 17:17:01 -0300 (ADT) Message-ID: <20040421201703.47640.qmail@web20802.mail.yahoo.com> X-Received: from [24.248.12.72] by web20802.mail.yahoo.com via HTTP; Wed, 21 Apr 2004 13:17:03 PDT Date: Wed, 21 Apr 2004 13:17:03 -0700 (PDT) From: Jeff Eckermann Subject: Re: Dealing with Insert Problems with Access To: Greg Campbell Cc: psql-odbc@postgresql.org In-Reply-To: <40868D00.2090708@us.michelin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-DCC: : X-Spam-Pyzor: ReSent-Date: Sat, 24 Apr 2004 01:35:38 -0300 (ADT) Resent-From: "Marc G. Fournier" Resent-To: pgsql-odbc@postgresql.org ReSent-Subject: Re: [ODBC] Dealing with Insert Problems with Access ReSent-Message-ID: <20040424013538.A42925@ganymede.hub.org> X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200404/118 X-Sequence-Number: 4013 --- Greg Campbell wrote: > I am not absolutely sure about this, so I hope those > who are don't > crucify me. > I think using underlying tables with OIDs and/or > using a timestamp > (default value of Now()) > help the ODBC driver keep track of which record is > which. > I think the #DELETED# is because after some change - > it doesn't know > which record is which. > I do not think the VBA code even needs to refer to > the OID or the > timestamp for this to work. You are thinking of a different case, probably more frequent in practice. That one happens with updates: the story IIRC is that, before saving an update, Access fetches back the record and compares it with the saved "old" values, to make sure that the record has not been altered since it was first displayed to the user. Some oddities can cause Access to be fooled into giving spurious errors. I know that checking "row versioning" in the driver fixes it, apparently by substituting a guaranteed unique row id (ctid? I forget). There is more on this in the psqlodbc project site. > > Jeff Eckermann wrote: > > >I have just deployed a MS Access client-server > >application with a PostgreSQL 7.2.4 backend (not > that > >the version matters in this case). I am bumping up > >against the famous "#Deleted#" in every field issue > >that comes up on this list from time to time. > > > >The problem is that, in this application, the data > can > >be quite sparse for some records, with the result > that > >some records only differ in their primary key > value, > >which is a serial in PostgreSQL. When a new record > >gets created, Access fails to find a unique record > >with the same data values, so the error. > > > >I don't want to move to unbound forms/controls, so > I > >am looking for a minimalist way to solve the > problem, > >which would involve adding some "before insert" > code > >which will specify a unique value to be inserted. > I > >am looking at two choices: > > > >* Do a "nextval" call to get the next serial value, > >and specify it explicitly. This involves an extra > >network round trip (and an extra connection), but > has > >the benefit of being unequivocal. > > > >* Add a timestamp field to the table, and specify > the > >applicable value in my vba code. > > > >This app is not intensively used, so either > solution > >would probably work fine in practice. Is there any > >reason why I should prefer one over the other? Or > is > >there another kind of solution altogether that I > could > >try? > > > >TIA > > > > > > > > > > > >__________________________________ > >Do you Yahoo!? > >Yahoo! Photos: High-quality 4x6 digital prints for > 25¢ > >http://photos.yahoo.com/ph/print_splash > > > >---------------------------(end of > broadcast)--------------------------- > >TIP 1: subscribe and unsubscribe commands go to > majordomo@postgresql.org > > > > > > 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 > > __________________________________ Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25¢ http://photos.yahoo.com/ph/print_splash