Received: from u1.abs.net (root@u1.abs.net [207.114.0.131]) by hub.org (8.8.8/8.7.5) with ESMTP id TAA08801 for ; Wed, 27 May 1998 19:33:00 -0400 (EDT) Received: from insightdist.com (nobody@localhost) by u1.abs.net (8.8.5/8.8.5(+AntiRelay)) with UUCP id TAA24457 for pgsql-interfaces@postgreSQL.org; Wed, 27 May 1998 19:16:01 -0400 (EDT) X-Authentication-Warning: u1.abs.net: nobody set sender to insightdist.com!byronn using -f Received: from ceodev by insightdist.com (AIX 3.2/UCB 5.64/4.03) id AA37508; Wed, 27 May 1998 19:10:25 -0400 Received: from ppp0_ceodev by ceodev (AIX 4.1/UCB 5.64/4.03) id AA52890; Wed, 27 May 1998 19:10:23 -0400 Message-Id: <356C9BC6.3CC5219A@insightdist.com> Date: Wed, 27 May 1998 19:03:35 -0400 From: Byron Nikolaidis X-Mailer: Mozilla 4.05 [en] (Win95; I) Mime-Version: 1.0 To: "Krasnow, Greg" Cc: pgsql-interfaces Subject: Re: [INTERFACES] VB, RDO, and Parameters References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Krasnow, Greg wrote: > Has anyone been able to create Parameterized queries for PostresSQL (using > PostODBC)? > > I have a VB app which works fine for Oracle, Access, DB/2, Informix, etc... > and I am trying to use it with a postgres database. In the app I have a > parameter query (i.e. "SELECT ... WHERE fdl1 = ?") I was getting a parse > error on this from the psotgres engine. I then tried using "SELECT ... > WHERE fld1 = $1" and am now getting parameter $1 out of range? Has anyone > out there done anything similar to this? > The postgres backend can't handle parameters like this. But, the odbc driver can. If you create your sql with the parameter markers (?) and then use SQLBindParameter to supply the parameter values. The driver then replaces the parameter markers with your parameter data. Access and others do this all the time and it works great! Now, as far as VB goes, I'm not sure how SQLBindParameter translates. Hope this helps. Byron