BUG #5194: fire IDispatch Error #3015 when run PutCollect() in ADO

From: "goldenhawking" <goldenhawking(at)vip(dot)163(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5194: fire IDispatch Error #3015 when run PutCollect() in ADO
Date: 2009-11-17 05:26:30
Message-ID: 200911170526.nAH5QUjl001669@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 5194
Logged by: goldenhawking
Email address: goldenhawking(at)vip(dot)163(dot)com
PostgreSQL version: 8.4.1
Operating system: Ubuntu 9.10 accessed by Vista Home basic
Description: fire IDispatch Error #3015 when run PutCollect() in ADO
Details:

I have to convert our group's code from MySQL to pgSQL , this project was
built and tested first under MS-Access 2003, then to MY-SQL 5.0, 5.1, and
now they want me to convert it to pgSQL because some large table need to be
divided into sub tables, pg is a good chioce.
the pg Server is inited in Ubuntu 9.10, testing tables has been created very
simple(I'm a beginner in pgSQL),
sindex varchar (24)(PK)
strname varchar (24)
sage integer
spicture bytea
coded as UTF-8 (to hold asian chars)

the client program runs on MS Vista Home, built by MSVC2008. because this
project is first for MS Access 2003, All DB opers are coded as ADo-Record
set.

I use pgODBC 8.4.00100,has connection string like:
"Driver={PostgreSQL
Unicode};Server=localhost;Port=5432;Database=test;Uid=postgres;Pwd=XXXX;Byte
aAsLongVarBinary=1;ReadOnly=0;"

and then I open a connection as

m_pConnection->CursorLocation = adUseClient;
m_pConnection->ConnectionTimeout = 15;
m_pConnection->Open(m_pstrConn,"","",adModeUnknown);

open the recode set like
pstrSQL = _T("select * from student");
HRESULT hr =
m_pRecordset->Open(pstrSQL,_variant_t((IDispatch
*)m_pConnection,true), adOpenDynamic,adLockPessimistic,adCmdText);

and insert first new item

m_pRecordset->AddNew();
m_pRecordset->PutCollect(_T("sindex"),_bstr_t(strIndex));
...

when the debugger runs on
m_pRecordset->PutCollect(_T("sindex"),_...

it throws an com error that tells me "Mulit-step oper error, please check
the state value for each step "(Translated by my self from asian language)
the errmsg: Idispatch error #3015

I just changes the connection str to mysql, access, mssql, my code runs
well, but this exception continues occure in pgSQL, I googled for a whole
day get few help.

please ,please help me! I can insert the item in psql, and in ado with
"sprintf(sql,"insert into student(...""
however, our code has a huge amount of "AddItem,Update...",I have no time
to convert all of them to insert!
please!

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Heikki Linnakangas 2009-11-17 11:26:15 Re: Multixact and prepared transactions
Previous Message Tom Lane 2009-11-17 01:34:40 Re: BUG #5193: should "select * from ab limitkkk" cause a syntax error?