Re: Access - ODBC - serial problem...

From: Richard Combs <rncombs(at)covad(dot)net>
To: Philippe Lang <philippe(dot)lang(at)attiksystem(dot)ch>, pgsql-odbc(at)postgresql(dot)org
Subject: Re: Access - ODBC - serial problem...
Date: 2004-04-08 20:31:49
Message-ID: 4075B6B5.9070805@covad.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

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
>
>
>
>

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message Steve Jorgensen 2004-04-09 01:15:31 Re: Access - ODBC - serial problem...
Previous Message Philippe Lang 2004-04-08 18:15:20 Re: Access - ODBC - serial problem...