X-Original-To: pgsql-odbc-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 6059F9FB253 for ; Tue, 22 Aug 2006 21:21:47 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 16820-03 for ; Wed, 23 Aug 2006 00:21:29 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from stash.illumen.com (unknown [64.207.29.137]) by postgresql.org (Postfix) with ESMTP id 880F39FB257 for ; Tue, 22 Aug 2006 21:21:29 -0300 (ADT) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Re: ADO and sequences Date: Tue, 22 Aug 2006 18:21:27 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [ODBC] ADO and sequences Thread-Index: AcbGPTihftkccP4/TA+dHDGR1E1+HQADI9Sg From: "Benjamin Krajmalnik" To: "Andreas" , X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL X-Spam-Level: *** X-Archive-Number: 200608/78 X-Sequence-Number: 8042 If you want autoincrement fields to be fully portable, then you will have to do this client side. You can do this by creating a table where youhold the next values, and retrieve from them. This is similar to the way PosgtreSQL sequences work internally. Or, one other way it to have a record where yo identify the backend type, and depending on the backend run specific code snippets. =20 > -----Original Message----- > From: pgsql-odbc-owner@postgresql.org=20 > [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Andreas > Sent: Tuesday, August 22, 2006 4:49 PM > To: pgsql-odbc@postgresql.org > Subject: Re: [ODBC] ADO and sequences >=20 >=20 > Thanks, I did it that way but I'd like to have a workaround=20 > that doesn't tie my application to one single RDBMS. > My initial plan was to create an adodb-connection to the=20 > current db backend on start of my application and the rest of=20 > the program wouldn't need to be aware what RDBMS actually=20 > manages the data in this session. > This would be postgres in my LAN and JET directly accessing=20 > MDB-files on a notebook pc where I'd rather not always run a=20 > server in the background. >=20 >=20 > Johann schrieb: > > Easiest way I've found is to read NextVal on the relevant sequence,=20 > > and use the value you get for the key field. > > > > Since the field will be loaded, the "default" function that assigns=20 > > the number, kind of like an Access Autonumber - will *not* override=20 > > the value you manually insert. > > > > So: > > Get nextval on sequence > > .addnew > > recordset!idfield =3D thenextvalyougot > > >=20 > ---------------------------(end of=20 > broadcast)--------------------------- > TIP 3: Have you checked our extensive FAQ? >=20 > http://www.postgresql.org/docs/faq >=20