Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id AAEC09FB408 for ; Tue, 10 Jul 2007 10:00:49 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 82197-05 for ; Tue, 10 Jul 2007 10:00:43 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by postgresql.org (Postfix) with SMTP id 8EBBA9FB48C for ; Tue, 10 Jul 2007 10:00:38 -0300 (ADT) Received: (qmail invoked by alias); 10 Jul 2007 13:00:36 -0000 Received: from i3ED6CBB7.versanet.de (EHLO [192.168.0.112]) [62.214.203.183] by mail.gmx.net (mp001) with SMTP; 10 Jul 2007 15:00:36 +0200 X-Authenticated: #14269776 X-Provags-ID: V01U2FsdGVkX1+eLtY2Y+6e0nOr7XZ29jm5aLfK//8aWjv2pYkwWD tU8Ijv595iAhAC Message-ID: <469382FC.6020707@gmx.net> Date: Tue, 10 Jul 2007 15:00:44 +0200 From: Andreas User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.8.1.4) Gecko/20070509 SeaMonkey/1.1.2 MIME-Version: 1.0 To: Eric E CC: pgsql-odbc@postgresql.org Subject: Re: Problem getting sequences under 8.02.03.00 driver References: <4692C515.1050509@gmail.com> In-Reply-To: <4692C515.1050509@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/5 X-Sequence-Number: 9060 Eric E schrieb: > Hi all, > I installed the 8.02.03.00 driver during my installation of > Postgres 8.2 onto my machine. After installation of that driver, the > following code related to sequences would not work: [...] > Where sSequenceName is holding the name of a sequence in the > search_path visible to the connection. The problem is that the value > returned from the ADODB Recordset is always 0. I can get a sequence > perfectly well using pgAdmin, and logs of statements showed that the > driver was in fact executing the SELECT nextval statement. I can also > execute other SELECT statements just fine using the Connection and > Recordset objects. For some reason, however, sequence values are > always returned as 0. Maybe it's because you define the resulting type as text? I've installed latest ODBC V8.0.2.04.01 and there a similar query works. Dim objRstADO As ADODB.Recordset Set objRstADO = objConnADO.Execute("SELECT nextval('" & strSequenceName & "')", , adLockReadOnly) debug.print Nz(objRstADO(0), 0) Is the Login-role in the connectionstring the same as you use in pgAdmin? Perhaps - ok, not very likely - is your ADO connection just not allowed to see the sequence. Depending on your function's error handler there could be a hidden error condition and the function delivers the default value for numeric types = 0.