pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Eric E <whalesuit@gmail.com>
To: pgsql-odbc@postgresql.org
Subject: Problem getting sequences under 8.02.03.00 driver
Date: Mon, 09 Jul 2007 19:30:29 -0400
Message-ID: <4692C515.1050509@gmail.com> (raw)

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:

     Dim cnGetAutoGenID As ADODB.Connection

     ' Get a local handle to the single ADO connection
     Set cnGetAutoGenID = GetPgADOConnection
     Dim sSequenceName As String, sGetIDSQL As String

     sGetIDSQL = "SELECT nextval('""" & sSequenceName & """'::text) as 
seqval;"

     Dim rsSeqVal As New ADODB.Recordset

     Set rsSeqVal = cnGetAutoGenID.Execute(sGetIDSQL) ' Execute the SQL
     With rsSeqVal
         ' If there are now rows in this recordset, then there was an
	' error getting the sequence value
         If .BOF Then
             GoTo Err_GetAutogenID
         Else
             GetAutogenID = .Fields("seqval")
         End If
     End With

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.

By rolling back to the 8.02.01.00 driver I was able to solve the 
problem, but I'm concerned that this bug will keep me from being able to 
move forward in versions of Postgres, and keep me from getting other 
fixes.  Does anyone recognize this problem or know anything about the 
nature of it?

Thanks,

Eric



view thread (3+ messages)  latest in thread

Message-ID: <4692C515.1050509@gmail.com>
Permalink:  ../4692C515.1050509@gmail.com/
Also on:    postgresql.org/message-id/4692C515.1050509@gmail.com

 · 

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: whalesuit@gmail.com
  Subject: Re: Problem getting sequences under 8.02.03.00 driver
  In-Reply-To: <4692C515.1050509@gmail.com>
  References: <4692C515.1050509@gmail.com>

* 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