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

Re: ADO and sequences

From: "Benjamin Krajmalnik" <kraj(at)illumen(dot)com>
To: "Andreas" <maps(dot)on(at)gmx(dot)net>,<pgsql-odbc(at)postgresql(dot)org>
Subject: Re: ADO and sequences
Date: 2006-08-23 00:21:27
Message-ID: BF337097BDD9D849A2F4B818DDB27987252611@stash.stackdump.local (view raw, whole thread or download thread mbox)
Lists: pgsql-odbc
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.


> -----Original Message-----
> From: pgsql-odbc-owner(at)postgresql(dot)org 
> [mailto:pgsql-odbc-owner(at)postgresql(dot)org] On Behalf Of Andreas
> Sent: Tuesday, August 22, 2006 4:49 PM
> To: pgsql-odbc(at)postgresql(dot)org
> Subject: Re: [ODBC] ADO and sequences
> Thanks, I did it that way but I'd like to have a workaround 
> that doesn't tie my application to one single RDBMS.
> My initial plan was to create an adodb-connection to the 
> current db backend on start of my application and the rest of 
> the program wouldn't need to be aware what RDBMS actually 
> manages the data in this session.
> This would be postgres in my LAN and JET directly accessing 
> MDB-files on a notebook pc where I'd rather not always run a 
> server in the background.
> Johann schrieb:
> > Easiest way I've found is to read NextVal on the relevant sequence, 
> > and use the value you get for the key field.
> >
> > Since the field will be loaded, the "default" function that assigns 
> > the number, kind of like an Access Autonumber - will *not* override 
> > the value you manually insert.
> >
> > So:
> > Get nextval on sequence
> > .addnew
> > recordset!idfield = thenextvalyougot
> >
> ---------------------------(end of 
> broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?

pgsql-odbc by date

Next:From: JohannDate: 2006-08-23 03:42:51
Subject: Re: ADO and sequences
Previous:From: AndreasDate: 2006-08-22 22:49:28
Subject: Re: ADO and sequences

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