pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Benjamin Krajmalnik <kraj@illumen.com>
To: Andreas <maps.on@gmx.net>
To: pgsql-odbc@postgresql.org
Subject: Re: ADO and sequences
Date: Tue, 22 Aug 2006 18:21:27 -0600
Message-ID: <BF337097BDD9D849A2F4B818DDB27987252611@stash.stackdump.local> (raw)

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@postgresql.org 
> [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
> 
> 
> 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?
> 
>                http://www.postgresql.org/docs/faq
> 



view thread (10+ messages)  latest in thread

Message-ID: <BF337097BDD9D849A2F4B818DDB27987252611@stash.stackdump.local>
Permalink:  ../BF337097BDD9D849A2F4B818DDB27987252611@stash.stackdump.local/
Also on:    postgresql.org/message-id/BF337097BDD9D849A2F4B818DDB27987252611@stash.stackdump.local

 · 

reply

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: kraj@illumen.com, maps.on@gmx.net
  Subject: Re: ADO and sequences
  In-Reply-To: <BF337097BDD9D849A2F4B818DDB27987252611@stash.stackdump.local>
  References: <BF337097BDD9D849A2F4B818DDB27987252611@stash.stackdump.local>

* 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