Syntax for updating blob fields in C++ VSDK

Matthew Jew mjew at icnc.com
Thu Oct 12 20:38:01 CDT 2006


The earlier messages did not really answer my question about the syntax.

In desperation, I just tried to update the field like I do the other,  
non-Text fields:

aHTMLTemplateTable->valueText->get_Value(forUpdate)->put_String 
( templateBodyC );
aHTMLTemplateTable->Table->UpdateRecord();

even though the string in 'templateBodyC' is very long, it seems to  
work.

Is this okay to do?

- Matthew

On Oct 12, 2006, at 12:50 PM, Ruslan Zasukhin wrote:

> On 10/12/06 10:07 PM, "Matthew Jew" <mjew at icnc.com> wrote:
>
> Hi Matthew,
>
>> I am having difficulty figuring out the syntax for doing an update in
>> a blob field using the C++ API VSDK.
>>
>> I can do this:
>>
>> I_FldBlob_Ptr pBlobField = dynamic_cast< I_FldBlob* >
>> (aHTMLTemplateTable->valueText.get());
>
> I recommend write this as:
>
> I_FldBlob_Ptr pBlobField = fbl_dynamic_cast<I_FldBlob>
>                                  (aHTMLTemplateTable->valueText);
>
>
> fbl_dynamic_cast -- this is helper macro, that allow do easier  
> syntax using
> SMART PTRS.
>
> Also remember about Query_Interface and QI macro:
>
> I_FldBlob_Ptr pBlobField = QI( aHTMLTemplateTable->valueText,  
> I_FldBlob );
>
>
>> pBlobField->WriteData( (const char*) templateBodyC,
>> templateBodyLength );
>
>
>> and it compiles, but at runtime, it complains:
>>
>> Error code        : 525582
>> Error description: Field "valueText": value was not prepared for
>> Update.
>>
>> I am not sure where the ->get_Value( forUpdate ) goes.
>>
>> I have tried to place it in various positions, like I do for a normal
>> field update:
>>
>> aNewsgroupTable->articleTag->get_Value(forUpdate)->put_String
>> ( articleTag );
>>
>> but I can't get it to compile.
>>
>> What is the syntax for accomplishing this?
>
>
>
> -- 
> Best regards,
>
> Ruslan Zasukhin
> VP Engineering and New Technology
> Paradigma Software, Inc
>
> Valentina - Joining Worlds of Information
> http://www.paradigmasoft.com
>
> [I feel the need: the need for speed]
>
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina



More information about the Valentina mailing list