Re: ADO and sequences
От | Benjamin Krajmalnik |
---|---|
Тема | Re: ADO and sequences |
Дата | |
Msg-id | BF337097BDD9D849A2F4B818DDB27987252611@stash.stackdump.local обсуждение исходный текст |
Ответ на | ADO and sequences (Andreas <maps.on@gmx.net>) |
Список | 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@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 >
В списке pgsql-odbc по дате отправления: