Re: Problem on calling procedures with ADODB

From: Adrian Grucza <adrian(dot)grucza(at)iress(dot)com>
To: Kamil ADEM <kamila(at)aqvilasoftware(dot)com>
Cc: "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: Problem on calling procedures with ADODB
Date: 2021-09-16 11:06:51
Message-ID: CADF4wWpFgFNyB=XxrVDKo=cG2n5N3p3pxo-XqwQTeToGSEUeZQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hi Kamil,

Have you tried changing pCommand->CommandText to _bstr_t("CALL sp_TEST(?,
?, ?)"), with one question mark per parameter?

Adrian Grucza
Technical Lead
Tel: +61390185800
adrian(dot)grucza(at)iress(dot)com
www.iress.com
Level 16 385 Bourke St
Melbourne, Victoria, 3000
The contents of this email originated from Iress. For this purpose Iress includes Iress Limited and/or any of its subsidiaries, holding companies and trading entities. ​If you have received this email in error please notify the sender immediately and delete this email.
nosig
On Thu, 16 Sept 2021 at 17:49, Kamil ADEM <kamila(at)aqvilasoftware(dot)com> wrote:

>
>
> *CAUTION: *This Email is from an EXTERNAL source. Ensure you trust this
> sender before clicking on any links or attachments.
>
>
> Hello,
>
>
>
> We porting a Windows MFC application from MSSQLServer to PostgreSQL and
> trying to use psqlODBC driver with Microsoft ADODB.
>
> We are currently performing the migration steps of our C sources and got
> stuck on an issue and thought to ask for your help.
>
>
>
> We use Microsoft ADODB on Windows to access the database and cannot change
> this interface in short time. To access Postgres we changed the connection
> string accordingly. (e.g. “Driver= {PostgreSQL ANSI};”)
>
> On calling Postgres procedures we have the following code sample:
>
> _CommandPtr pCommand;
>
> pCommand->CommandType = adCmdStoredProc;
>
> pCommand->CommandText = _bstr_t(“sp_TEST”);
>
> pCommand->Parameters->Refresh();
>
> pCommand->Execute(NULL, NULL, adCmdStoredProc | adExecuteNoRecords);
>
> The Execute() method generates the command: “SELECT * FROM sp_TEST(…)”
> instead of “CALL sp_TEST(…)”. This is appropriate for Postgres functions,
> but there must be a way to call procedures also.
>
> Do you know such a reported issue? Do you know a way to change this
> behaviour? Should we use a different driver? Should we get rid of
> procedures and convert our MSSQL stored procedures to Postgres functions?
>
>
>
> We would be grateful if you can guide us to the right solution.
>
> Thanks in advance.
>
>
>
> Best regards,
>
>
>
> Kamil Adem
>
> Aqvila Software Yazılım A.Ş.
>
>
>
>
>
>
>

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Kamil ADEM 2021-09-16 13:23:23 RE: Problem on calling procedures with ADODB
Previous Message Kamil ADEM 2021-09-16 07:49:34 Problem on calling procedures with ADODB