Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Access fields with long varchar data type in VC++

4 posts in General Discussion Last posting was on 2006-05-30 21:38:19.0Z
hui Posted on 2006-05-23 04:38:20.0Z
Reply-To: "hui" <huibinchen2000@163.com>
From: "hui" <huibinchen2000@163.com>
Newsgroups: ianywhere.public.general
Subject: Access fields with long varchar data type in VC++
Lines: 4
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 218.74.198.5
X-Original-NNTP-Posting-Host: 218.74.198.5
Message-ID: <447291bc@forums-1-dub>
Date: 22 May 2006 21:38:20 -0700
X-Trace: forums-1-dub 1148359100 218.74.198.5 (22 May 2006 21:38:20 -0700)
X-Original-Trace: 22 May 2006 21:38:20 -0700, 218.74.198.5
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5368
Article PK: 1416

How can I read and write fields with long varchar data type using ADO in
VC++ 6.0?


Rob Waywell Posted on 2006-05-24 19:04:21.0Z
From: "Rob Waywell" <rwaywell_no_spam_please@ianywhere.com>
Newsgroups: ianywhere.public.general
References: <447291bc@forums-1-dub>
Subject: Re: Access fields with long varchar data type in VC++
Lines: 30
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
X-Original-NNTP-Posting-Host: 10.25.98.235
Message-ID: <4474adcd$1@forums-2-dub>
X-Original-Trace: 24 May 2006 12:02:37 -0700, 10.25.98.235
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 24 May 2006 12:02:38 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 24 May 2006 12:04:21 -0700
X-Trace: forums-1-dub 1148497461 10.22.108.75 (24 May 2006 12:04:21 -0700)
X-Original-Trace: 24 May 2006 12:04:21 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5382
Article PK: 1432

What have you tried so far?
What specific error are you encountering?
What version and build # of ASA?

--
-----------------------------------------------
Robert Waywell
Sybase Adaptive Server Anywhere Developer - Version 8
Sybase Certified Professional

Sybase's iAnywhere Solutions

Please respond ONLY to newsgroup

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports:
http://case-express.sybase.com/cx/cx.stm?starturl=casemessage.ssc?CASETYPE=Bug

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

"hui" <huibinchen2000@163.com> wrote in message
news:447291bc@forums-1-dub...
> How can I read and write fields with long varchar data type using ADO in
> VC++ 6.0?
>


hui Posted on 2006-05-28 23:47:20.0Z
Reply-To: "hui" <huibinchen2000@163.com>
From: "hui" <huibinchen2000@163.com>
Newsgroups: ianywhere.public.general
References: <447291bc@forums-1-dub> <4474adcd$1@forums-2-dub>
Subject: Re: Access fields with long varchar data type in VC++
Lines: 76
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
X-RFC2646: Format=Flowed; Response
X-Original-NNTP-Posting-Host: 217.121.0.218.broad.nb.zj.dynamic.cndata.com
Message-ID: <447a360a@forums-2-dub>
X-Original-Trace: 28 May 2006 16:45:14 -0700, 217.121.0.218.broad.nb.zj.dynamic.cndata.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 28 May 2006 16:45:14 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 28 May 2006 16:47:20 -0700
X-Trace: forums-1-dub 1148860040 10.22.108.75 (28 May 2006 16:47:20 -0700)
X-Original-Trace: 28 May 2006 16:47:20 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5398
Article PK: 1448

I find the answer in the MSDN Library, where there are ADO Code Examples in
Visual C++ in ADO Programmer's Reference. The title of the article
corresponding is "AppendChunk and GetChunk Methods Example (VC++)", which
use the AppendChunk and GetChunk methods to fill an image field with data
from another record. The codes calling AppendChunk are rewritten here:

//Assign the Safe array to a variant.
varChunk.vt = VT_ARRAY|VT_UI1;
varChunk.parray = psa;
hr = pRstPubInfo->Fields->GetItem("logo")->
AppendChunk(varChunk);

where psa is a safe array with 1 dimension and its element has a VT_UI1 data
type, pRstPubInfo has type _RecordsetPtr, and the "logo" is an image field.
Besides, there are codes writing a long varchar field:

pRstPubInfo->Fields->GetItem("pr_info")->
PutValue(pubrs.m_sz_prinfo);

where "pr_info" is an long varchar field, and pubrs.m_sz_prinfo is a
character array.

I tested the above codes in SQL Anywhere 9, and they worked well. I alse
tried to use AppendChunk to write the long varchar field, but it failed. The
codes I used are rewritten in the following:

//Assign the Safe array to a variant.
varChunk2.vt = VT_ARRAY|VT_I1;
varChunk2.parray = psa2;
hr = pRstPubInfo->Fields->GetItem("pr_info")->
AppendChunk(varChunk);

where psa2 is a safe array with 1 dimension and its element has a VT_I1
element data type. The error code is 800a0bb9, and the description is:

Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.

Can you tell me the correct methods used to write a long varchar field by
calling AppendChunk?

Thank you in advance.

"Rob Waywell" <rwaywell_no_spam_please@ianywhere.com> дÈëÏûÏ¢ÐÂÎÅ:4474adcd$1@forums-2-dub...

> What have you tried so far?
> What specific error are you encountering?
> What version and build # of ASA?
>
> --
> -----------------------------------------------
> Robert Waywell
> Sybase Adaptive Server Anywhere Developer - Version 8
> Sybase Certified Professional
>
> Sybase's iAnywhere Solutions
>
> Please respond ONLY to newsgroup
>
> EBF's and Patches: http://downloads.sybase.com
> choose SQL Anywhere Studio >> change 'time frame' to all
>
> To Submit Bug Reports:
> http://case-express.sybase.com/cx/cx.stm?starturl=casemessage.ssc?CASETYPE=Bug
>
> SQL Anywhere Studio Supported Platforms and Support Status
> http://my.sybase.com/detail?id=1002288
>
> "hui" <huibinchen2000@163.com> wrote in message
> news:447291bc@forums-1-dub...
>> How can I read and write fields with long varchar data type using ADO in
>> VC++ 6.0?
>>
>
>


Rob Waywell Posted on 2006-05-30 21:38:19.0Z
From: "Rob Waywell" <rwaywell_no_spam_please@ianywhere.com>
Newsgroups: ianywhere.public.general
References: <447291bc@forums-1-dub> <4474adcd$1@forums-2-dub> <447a360a@forums-2-dub>
Subject: Re: Access fields with long varchar data type in VC++
Lines: 197
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: rwaywell-xp2.sybase.com
X-Original-NNTP-Posting-Host: rwaywell-xp2.sybase.com
Message-ID: <447cbb4b$1@forums-1-dub>
Date: 30 May 2006 14:38:19 -0700
X-Trace: forums-1-dub 1149025099 10.25.98.235 (30 May 2006 14:38:19 -0700)
X-Original-Trace: 30 May 2006 14:38:19 -0700, rwaywell-xp2.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5409
Article PK: 1459

Here is an example that should work.


--
-----------------------------------------------
Robert Waywell
Sybase Adaptive Server Anywhere Developer - Version 8
Sybase Certified Professional

Sybase's iAnywhere Solutions

Please respond ONLY to newsgroup

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports:
http://case-express.sybase.com/cx/cx.stm?starturl=casemessage.ssc?CASETYPE=Bug

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

"hui" <huibinchen2000@163.com> wrote in message
news:447a360a@forums-2-dub...
>I find the answer in the MSDN Library, where there are ADO Code Examples in
> Visual C++ in ADO Programmer's Reference. The title of the article
> corresponding is "AppendChunk and GetChunk Methods Example (VC++)", which
> use the AppendChunk and GetChunk methods to fill an image field with data
> from another record. The codes calling AppendChunk are rewritten here:
>
> //Assign the Safe array to a variant.
> varChunk.vt = VT_ARRAY|VT_UI1;
> varChunk.parray = psa;
> hr = pRstPubInfo->Fields->GetItem("logo")->
> AppendChunk(varChunk);
>
> where psa is a safe array with 1 dimension and its element has a VT_UI1
> data
> type, pRstPubInfo has type _RecordsetPtr, and the "logo" is an image
> field.
> Besides, there are codes writing a long varchar field:
>
> pRstPubInfo->Fields->GetItem("pr_info")->
> PutValue(pubrs.m_sz_prinfo);
>
> where "pr_info" is an long varchar field, and pubrs.m_sz_prinfo is a
> character array.
>
> I tested the above codes in SQL Anywhere 9, and they worked well. I alse
> tried to use AppendChunk to write the long varchar field, but it failed.
> The
> codes I used are rewritten in the following:
>
> //Assign the Safe array to a variant.
> varChunk2.vt = VT_ARRAY|VT_I1;
> varChunk2.parray = psa2;
> hr = pRstPubInfo->Fields->GetItem("pr_info")->
> AppendChunk(varChunk);
>
> where psa2 is a safe array with 1 dimension and its element has a VT_I1
> element data type. The error code is 800a0bb9, and the description is:
>
> Arguments are of the wrong type, are out of acceptable range, or are in
> conflict with one another.
>
> Can you tell me the correct methods used to write a long varchar field by
> calling AppendChunk?
>
> Thank you in advance.
>
> "Rob Waywell" <rwaywell_no_spam_please@ianywhere.com>
> дÈëÏûÏ¢ÐÂÎÅ:4474adcd$1@forums-2-dub...
>> What have you tried so far?
>> What specific error are you encountering?
>> What version and build # of ASA?
>>
>> --
>> -----------------------------------------------
>> Robert Waywell
>> Sybase Adaptive Server Anywhere Developer - Version 8
>> Sybase Certified Professional
>>
>> Sybase's iAnywhere Solutions
>>
>> Please respond ONLY to newsgroup
>>
>> EBF's and Patches: http://downloads.sybase.com
>> choose SQL Anywhere Studio >> change 'time frame' to all
>>
>> To Submit Bug Reports:
>> http://case-express.sybase.com/cx/cx.stm?starturl=casemessage.ssc?CASETYPE=Bug
>>
>> SQL Anywhere Studio Supported Platforms and Support Status
>> http://my.sybase.com/detail?id=1002288
>>
>> "hui" <huibinchen2000@163.com> wrote in message
>> news:447291bc@forums-1-dub...
>>> How can I read and write fields with long varchar data type using ADO in
>>> VC++ 6.0?
>>>
>>
>>
>
>