Re: [INTERFACES] VB, RDO, and Parameters

From: Byron Nikolaidis <byronn(at)insightdist(dot)com>
To: "Krasnow, Greg" <gak(at)hnc(dot)com>
Cc: pgsql-interfaces <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: Re: [INTERFACES] VB, RDO, and Parameters
Date: 1998-05-27 23:03:35
Message-ID: 356C9BC6.3CC5219A@insightdist.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

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

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Byron Nikolaidis 1998-05-28 00:40:06 Re: Thank you! But how to get it working with VC++5?
Previous Message Krasnow, Greg 1998-05-27 21:43:40 VB, RDO, and Parameters