pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Using VC2008 to store bytea, I got AppendChunk error 800a0c93
7+ messages / 2 participants
[nested] [flat]

* Using VC2008 to store bytea, I got AppendChunk error 800a0c93
@ 2014-07-04 00:58  sunpeng <bluevaley@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: sunpeng @ 2014-07-04 00:58 UTC (permalink / raw)
  To: pgsql-odbc

My server is pg 9.1.13 in win8 64, my client is win xp 32 bit
installed psqlodbc_09_01_0200.zip(ide is VS2008, vc++).
When I store pic binary data to bytea (field is CapturePic) using:
try
 	{
 		m_pRecordset->AddNew();
		iTimes++;

 		VARIANT bitdata[3];

 		SAFEARRAY *psafe[3] = {NULL, NULL, NULL};
 		SAFEARRAYBOUND  band[3];

		if (pFreImg != NULL && FreImgSize > 0)
		{
			bitdata[0].vt = VT_ARRAY | VT_UI1;
			band[0].cElements = FreImgSize;
			band[0].lLbound = 0;
			psafe[0] = SafeArrayCreate(VT_UI1, 1, &band[0]);

			for (long iSize = 0; iSize < FreImgSize; iSize++)
			{
				SafeArrayPutElement(psafe[0], &iSize, &pFreImg[iSize]);
			}


			bitdata[0].parray = psafe[0];
			if (bitdata[0].parray != NULL)
			{
				m_pRecordset->GetFields()->GetItem("CapturePic")->AppendChunk(&bitdata[0]);
			}
...
                 m_pRecordset->Update();
...
}catch()

I got com_error (at line ...>AppendChunk() ),and see in AppendChunk():
HRESULT _hr = raw_AppendChunk(data);
I got: hresult 800a0c93

see http://tutorials.aspfaq.com/8000xxxxx-errors/why-do-i-get-800a0c93-errors.html

how to resolve it?


-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Using VC2008 to store bytea, I got AppendChunk error 800a0c93
@ 2014-07-04 03:49  Inoue, Hiroshi <inoue@tpf.co.jp>
  parent: sunpeng <bluevaley@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Inoue, Hiroshi @ 2014-07-04 03:49 UTC (permalink / raw)
  To: sunpeng <bluevaley@gmail.com>; +Cc: pgsql-odbc

Are you turning on *bytea as LO* option?

regards,
Hiroshi Inoue

(2014/07/04 9:58), sunpeng wrote:
> My server is pg 9.1.13 in win8 64, my client is win xp 32 bit
> installed psqlodbc_09_01_0200.zip(ide is VS2008, vc++).
> When I store pic binary data to bytea (field is CapturePic) using:
> try
>   	{
>   		m_pRecordset->AddNew();
> 		iTimes++;
>
>   		VARIANT bitdata[3];
>
>   		SAFEARRAY *psafe[3] = {NULL, NULL, NULL};
>   		SAFEARRAYBOUND  band[3];
>
> 		if (pFreImg != NULL && FreImgSize > 0)
> 		{
> 			bitdata[0].vt = VT_ARRAY | VT_UI1;
> 			band[0].cElements = FreImgSize;
> 			band[0].lLbound = 0;
> 			psafe[0] = SafeArrayCreate(VT_UI1, 1, &band[0]);
>
> 			for (long iSize = 0; iSize < FreImgSize; iSize++)
> 			{
> 				SafeArrayPutElement(psafe[0], &iSize, &pFreImg[iSize]);
> 			}
>
>
> 			bitdata[0].parray = psafe[0];
> 			if (bitdata[0].parray != NULL)
> 			{
> 				m_pRecordset->GetFields()->GetItem("CapturePic")->AppendChunk(&bitdata[0]);
> 			}
> ...
>                   m_pRecordset->Update();
> ...
> }catch()
>
> I got com_error (at line ...>AppendChunk() ),and see in AppendChunk():
> HRESULT _hr = raw_AppendChunk(data);
> I got: hresult 800a0c93
>
> see http://tutorials.aspfaq.com/8000xxxxx-errors/why-do-i-get-800a0c93-errors.html
>
> how to resolve it?


-- 
I am using the free version of SPAMfighter.
SPAMfighter has removed 11332 of my spam emails to date.
Get the free SPAMfighter here: http://www.spamfighter.com/len

Do you have a slow PC? Try a Free scan 
http://www.spamfighter.com/SLOW-PCfighter?cid=sigen



-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Using VC2008 to store bytea, I got AppendChunk error 800a0c93
@ 2014-07-04 06:35  sunpeng <bluevaley@gmail.com>
  parent: Inoue, Hiroshi <inoue@tpf.co.jp>
  0 siblings, 1 reply; 7+ messages in thread

From: sunpeng @ 2014-07-04 06:35 UTC (permalink / raw)
  To: Inoue, Hiroshi <inoue@tpf.co.jp>; +Cc: pgsql-odbc

Yea, I've set *bytea as LO* option in Page 2, but error still exists.
I use ADO instead of DataSource of ODBC.

peng


On Fri, Jul 4, 2014 at 11:49 AM, Inoue, Hiroshi <inoue@tpf.co.jp> wrote:

> Are you turning on *bytea as LO* option?
>
> regards,
> Hiroshi Inoue
>
>
> (2014/07/04 9:58), sunpeng wrote:
>
>> My server is pg 9.1.13 in win8 64, my client is win xp 32 bit
>> installed psqlodbc_09_01_0200.zip(ide is VS2008, vc++).
>> When I store pic binary data to bytea (field is CapturePic) using:
>> try
>>         {
>>                 m_pRecordset->AddNew();
>>                 iTimes++;
>>
>>                 VARIANT bitdata[3];
>>
>>                 SAFEARRAY *psafe[3] = {NULL, NULL, NULL};
>>                 SAFEARRAYBOUND  band[3];
>>
>>                 if (pFreImg != NULL && FreImgSize > 0)
>>                 {
>>                         bitdata[0].vt = VT_ARRAY | VT_UI1;
>>                         band[0].cElements = FreImgSize;
>>                         band[0].lLbound = 0;
>>                         psafe[0] = SafeArrayCreate(VT_UI1, 1, &band[0]);
>>
>>                         for (long iSize = 0; iSize < FreImgSize; iSize++)
>>                         {
>>                                 SafeArrayPutElement(psafe[0], &iSize,
>> &pFreImg[iSize]);
>>                         }
>>
>>
>>                         bitdata[0].parray = psafe[0];
>>                         if (bitdata[0].parray != NULL)
>>                         {
>>                                 m_pRecordset->GetFields()->
>> GetItem("CapturePic")->AppendChunk(&bitdata[0]);
>>                         }
>> ...
>>                   m_pRecordset->Update();
>> ...
>> }catch()
>>
>> I got com_error (at line ...>AppendChunk() ),and see in AppendChunk():
>> HRESULT _hr = raw_AppendChunk(data);
>> I got: hresult 800a0c93
>>
>> see http://tutorials.aspfaq.com/8000xxxxx-errors/why-do-i-get-
>> 800a0c93-errors.html
>>
>> how to resolve it?
>>
>
>
> --
> I am using the free version of SPAMfighter.
> SPAMfighter has removed 11332 of my spam emails to date.
> Get the free SPAMfighter here: http://www.spamfighter.com/len
>
> Do you have a slow PC? Try a Free scan http://www.spamfighter.com/
> SLOW-PCfighter?cid=sigen
>
>

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Using VC2008 to store bytea, I got AppendChunk error 800a0c93
@ 2014-07-05 00:19  Inoue, Hiroshi <inoue@tpf.co.jp>
  parent: sunpeng <bluevaley@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Inoue, Hiroshi @ 2014-07-05 00:19 UTC (permalink / raw)
  To: sunpeng <bluevaley@gmail.com>; +Cc: pgsql-odbc


(2014/07/04 15:35), sunpeng wrote:
> Yea, I've set *bytea as LO* option in Page 2, but error still exists.
> I use ADO instead of DataSource of ODBC.

What's the connection string you are using in your ADO app?

regards,
Hiroshi Inoue
>
> peng
>
>
> On Fri, Jul 4, 2014 at 11:49 AM, Inoue, Hiroshi <inoue@tpf.co.jp
> <mailto:inoue@tpf.co.jp>> wrote:
>
>     Are you turning on *bytea as LO* option?
>
>     regards,
>     Hiroshi Inoue
>
>
>     (2014/07/04 9:58), sunpeng wrote:
>
>         My server is pg 9.1.13 in win8 64, my client is win xp 32 bit
>         installed psqlodbc_09_01_0200.zip(ide is VS2008, vc++).
>         When I store pic binary data to bytea (field is CapturePic) using:
>         try
>                  {
>                          m_pRecordset->AddNew();
>                          iTimes++;
>
>                          VARIANT bitdata[3];
>
>                          SAFEARRAY *psafe[3] = {NULL, NULL, NULL};
>                          SAFEARRAYBOUND  band[3];
>
>                          if (pFreImg != NULL && FreImgSize > 0)
>                          {
>                                  bitdata[0].vt = VT_ARRAY | VT_UI1;
>                                  band[0].cElements = FreImgSize;
>                                  band[0].lLbound = 0;
>                                  psafe[0] = SafeArrayCreate(VT_UI1, 1,
>         &band[0]);
>
>                                  for (long iSize = 0; iSize <
>         FreImgSize; iSize++)
>                                  {
>                                          SafeArrayPutElement(psafe[0],
>         &iSize, &pFreImg[iSize]);
>                                  }
>
>
>                                  bitdata[0].parray = psafe[0];
>                                  if (bitdata[0].parray != NULL)
>                                  {
>
>         m_pRecordset->GetFields()->__GetItem("CapturePic")->__AppendChunk(&bitdata[0]);
>                                  }
>         ...
>                            m_pRecordset->Update();
>         ...
>         }catch()
>
>         I got com_error (at line ...>AppendChunk() ),and see in
>         AppendChunk():
>         HRESULT _hr = raw_AppendChunk(data);
>         I got: hresult 800a0c93
>
>         see
>         http://tutorials.aspfaq.com/__8000xxxxx-errors/why-do-i-get-__800a0c93-errors.html
>         <http://tutorials.aspfaq.com/8000xxxxx-errors/why-do-i-get-800a0c93-errors.html;
>
>         how to resolve it?
>
>
>
>     --
>     I am using the free version of SPAMfighter.
>     SPAMfighter has removed 11332 of my spam emails to date.
>     Get the free SPAMfighter here: http://www.spamfighter.com/len
>
>     Do you have a slow PC? Try a Free scan
>     http://www.spamfighter.com/__SLOW-PCfighter?cid=sigen
>     <http://www.spamfighter.com/SLOW-PCfighter?cid=sigen;
>
>


-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Using VC2008 to store bytea, I got AppendChunk error 800a0c93
@ 2014-07-07 03:44  sunpeng <bluevaley@gmail.com>
  parent: Inoue, Hiroshi <inoue@tpf.co.jp>
  0 siblings, 1 reply; 7+ messages in thread

From: sunpeng @ 2014-07-07 03:44 UTC (permalink / raw)
  To: Inoue, Hiroshi <inoue@tpf.co.jp>; +Cc: pgsql-odbc

hr = m_pConnection.CreateInstance("ADODB.Connection");
sql.Format(_T("Driver=%s;Server=%s;Database=%s"),strDriver,strIP,strDBName);

strDriver is "PostgreSQL ANSI" or "PostgreSQL Unicode"

On 7/5/14, Inoue, Hiroshi <inoue@tpf.co.jp> wrote:
>
> (2014/07/04 15:35), sunpeng wrote:
>> Yea, I've set *bytea as LO* option in Page 2, but error still exists.
>> I use ADO instead of DataSource of ODBC.
>
> What's the connection string you are using in your ADO app?
>
> regards,
> Hiroshi Inoue
>>
>> peng
>>
>>
>> On Fri, Jul 4, 2014 at 11:49 AM, Inoue, Hiroshi <inoue@tpf.co.jp
>> <mailto:inoue@tpf.co.jp>> wrote:
>>
>>     Are you turning on *bytea as LO* option?
>>
>>     regards,
>>     Hiroshi Inoue
>>
>>
>>     (2014/07/04 9:58), sunpeng wrote:
>>
>>         My server is pg 9.1.13 in win8 64, my client is win xp 32 bit
>>         installed psqlodbc_09_01_0200.zip(ide is VS2008, vc++).
>>         When I store pic binary data to bytea (field is CapturePic)
>> using:
>>         try
>>                  {
>>                          m_pRecordset->AddNew();
>>                          iTimes++;
>>
>>                          VARIANT bitdata[3];
>>
>>                          SAFEARRAY *psafe[3] = {NULL, NULL, NULL};
>>                          SAFEARRAYBOUND  band[3];
>>
>>                          if (pFreImg != NULL && FreImgSize > 0)
>>                          {
>>                                  bitdata[0].vt = VT_ARRAY | VT_UI1;
>>                                  band[0].cElements = FreImgSize;
>>                                  band[0].lLbound = 0;
>>                                  psafe[0] = SafeArrayCreate(VT_UI1, 1,
>>         &band[0]);
>>
>>                                  for (long iSize = 0; iSize <
>>         FreImgSize; iSize++)
>>                                  {
>>                                          SafeArrayPutElement(psafe[0],
>>         &iSize, &pFreImg[iSize]);
>>                                  }
>>
>>
>>                                  bitdata[0].parray = psafe[0];
>>                                  if (bitdata[0].parray != NULL)
>>                                  {
>>
>>
>> m_pRecordset->GetFields()->__GetItem("CapturePic")->__AppendChunk(&bitdata[0]);
>>                                  }
>>         ...
>>                            m_pRecordset->Update();
>>         ...
>>         }catch()
>>
>>         I got com_error (at line ...>AppendChunk() ),and see in
>>         AppendChunk():
>>         HRESULT _hr = raw_AppendChunk(data);
>>         I got: hresult 800a0c93
>>
>>         see
>>
>> http://tutorials.aspfaq.com/__8000xxxxx-errors/why-do-i-get-__800a0c93-errors.html
>>
>> <http://tutorials.aspfaq.com/8000xxxxx-errors/why-do-i-get-800a0c93-errors.html;
>>
>>         how to resolve it?
>>
>>
>>
>>     --
>>     I am using the free version of SPAMfighter.
>>     SPAMfighter has removed 11332 of my spam emails to date.
>>     Get the free SPAMfighter here: http://www.spamfighter.com/len
>>
>>     Do you have a slow PC? Try a Free scan
>>     http://www.spamfighter.com/__SLOW-PCfighter?cid=sigen
>>     <http://www.spamfighter.com/SLOW-PCfighter?cid=sigen;
>>
>>
>


-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Using VC2008 to store bytea, I got AppendChunk error 800a0c93
@ 2014-07-07 04:02  Inoue, Hiroshi <inoue@tpf.co.jp>
  parent: sunpeng <bluevaley@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Inoue, Hiroshi @ 2014-07-07 04:02 UTC (permalink / raw)
  To: sunpeng <bluevaley@gmail.com>; +Cc: pgsql-odbc

(2014/07/07 12:44), sunpeng wrote:
> hr = m_pConnection.CreateInstance("ADODB.Connection");
> sql.Format(_T("Driver=%s;Server=%s;Database=%s"),strDriver,strIP,strDBName);

Please add ";C7=1" which turns on *bytea as lo* option to your
connection string or
directly specify the data source name as the connectiion string
	_T("DSN=%s")
.

> strDriver is "PostgreSQL ANSI" or "PostgreSQL Unicode"

<snip>

>>>
>>>                                   for (long iSize = 0; iSize <
>>>          FreImgSize; iSize++)
>>>                                   {
>>>                                           SafeArrayPutElement(psafe[0],
>>>          &iSize, &pFreImg[iSize]);

Does SafeArrayPutElelment() work as you expect?
The input of the function is psafe[0] and the output is &pFreImg[iSize].

regards,
Hiroshi Inoue

-- 
I am using the free version of SPAMfighter.
SPAMfighter has removed 11419 of my spam emails to date.
Get the free SPAMfighter here: http://www.spamfighter.com/len

Do you have a slow PC? Try a Free scan 
http://www.spamfighter.com/SLOW-PCfighter?cid=sigen



-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Using VC2008 to store bytea, I got AppendChunk error 800a0c93
@ 2014-07-07 09:06  sunpeng <bluevaley@gmail.com>
  parent: Inoue, Hiroshi <inoue@tpf.co.jp>
  0 siblings, 0 replies; 7+ messages in thread

From: sunpeng @ 2014-07-07 09:06 UTC (permalink / raw)
  To: Inoue, Hiroshi <inoue@tpf.co.jp>; +Cc: pgsql-odbc

Thank you Hiroshi,
C7=1
and
("DSN=%s")

both works fine, thank you again!

peng


On Mon, Jul 7, 2014 at 12:02 PM, Inoue, Hiroshi <inoue@tpf.co.jp> wrote:

> (2014/07/07 12:44), sunpeng wrote:
>
>> hr = m_pConnection.CreateInstance("ADODB.Connection");
>> sql.Format(_T("Driver=%s;Server=%s;Database=%s"),
>> strDriver,strIP,strDBName);
>>
>
> Please add ";C7=1" which turns on *bytea as lo* option to your
> connection string or
> directly specify the data source name as the connectiion string
>         _T("DSN=%s")
>
> .
>
>  strDriver is "PostgreSQL ANSI" or "PostgreSQL Unicode"
>>
>
> <snip>
>
>
>
>>>>                                   for (long iSize = 0; iSize <
>>>>          FreImgSize; iSize++)
>>>>                                   {
>>>>                                           SafeArrayPutElement(psafe[0],
>>>>          &iSize, &pFreImg[iSize]);
>>>>
>>>
> Does SafeArrayPutElelment() work as you expect?
> The input of the function is psafe[0] and the output is &pFreImg[iSize].
>
> regards,
> Hiroshi Inoue
>
>
> --
> I am using the free version of SPAMfighter.
> SPAMfighter has removed 11419 of my spam emails to date.
>
> Get the free SPAMfighter here: http://www.spamfighter.com/len
>
> Do you have a slow PC? Try a Free scan http://www.spamfighter.com/
> SLOW-PCfighter?cid=sigen
>
>

^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2014-07-07 09:06 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-07-04 00:58 Using VC2008 to store bytea, I got AppendChunk error 800a0c93 sunpeng <bluevaley@gmail.com>
2014-07-04 03:49 ` Inoue, Hiroshi <inoue@tpf.co.jp>
2014-07-04 06:35   ` sunpeng <bluevaley@gmail.com>
2014-07-05 00:19     ` Inoue, Hiroshi <inoue@tpf.co.jp>
2014-07-07 03:44       ` sunpeng <bluevaley@gmail.com>
2014-07-07 04:02         ` Inoue, Hiroshi <inoue@tpf.co.jp>
2014-07-07 09:06           ` sunpeng <bluevaley@gmail.com>

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