pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Combs <rncombs@covad.net>
To: Philippe Lang <philippe.lang@attiksystem.ch>
To: pgsql-odbc@postgresql.org
Subject: Re: Access - ODBC - serial problem...
Date: Thu, 08 Apr 2004 15:31:49 -0500
Message-ID: <4075B6B5.9070805@covad.net> (raw)
In-Reply-To: <6C0CF58A187DA5479245E0830AF84F420802A1@poweredge.attiksystem.ch>
References: <6C0CF58A187DA5479245E0830AF84F420802A1@poweredge.attiksystem.ch>

 From what I know, SELECT @@IDENTITY, is a Transact SQL call that is a 
function of SQL server.  I think what is happening here, is Access is 
making the call to the server and generating the call.  Just an educated 
guess, but how would the ODBC driver know to make this call after an 
insert unless it kept track of the table schema for every table.  Seems 
like more of a higher level function, Access learns the schema for the 
tables you have open, then makes the proper call.  Of course being MS 
Access working with MS SQL might have something to do with it.

Tha'ts one of the reasons I wound up using the function/stored procedure 
solution.  The ODBC driver knows how to handle functions, and my front 
end doesn't have to know anything but how to put the proper pararmeters 
in and read them on return, after making the proper call.

Again, I'm not an Access person, so I can't pretend to know how to do 
this through Access tables.  It does work great when programming in 
Delphi though, or for that matter wrapping your SQL code in a higher 
level language.

Philippe Lang wrote:

>Hello,
>
>Thanks for your answers.
>
>select currval('test_id_seq') works, I have tested it. But the problem is that what I have described is done transparently by MS Access, when a line is added through a linked table, or through a subform. There is no opportunity for me to call currval, except if I insert a line into the table programmatically, what I want to avoid.
>
>Is there maybe a way to incorporate a call to currval into the driver?
>
>I have traced what SQL Server 2000 does, and there is call
>
>SELECT @@IDENTITY
>
>just after the insert. Does that mean that the problematic SQL call I have just talked about before
>
>select id from test where code = 20
>
>is a driver feature, more than a MS Access feature? If someone has an idea for a driver patch...
>
>Philippe
>
>
>  
>





view thread (12+ messages)  latest in thread

Message-ID: <4075B6B5.9070805@covad.net>
Permalink:  ../4075B6B5.9070805@covad.net/
Also on:    postgresql.org/message-id/4075B6B5.9070805@covad.net

 · 

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: rncombs@covad.net, philippe.lang@attiksystem.ch
  Subject: Re: Access - ODBC - serial problem...
  In-Reply-To: <4075B6B5.9070805@covad.net>
  References: <6C0CF58A187DA5479245E0830AF84F420802A1@poweredge.attiksystem.ch> <4075B6B5.9070805@covad.net>

* 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