Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.

Welcome, Guest
Guest Settings

Thread: Correct way to write to TBinaryField with simple data array?

This question is not answered. Helpful answers available: 2. Correct answers available: 1.

Permlink Replies: 0
Mike Knoblock

Posts: 24
Registered: 11/5/06
Correct way to write to TBinaryField with simple data array?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 20, 2015 10:05 AM
Using TADOQuery, etc with c++ Builder under RAD Studio XE7.

I'm doing database record read/writes to an SQL database with a binary(32) column. I've used TBlobField successfully on larger data images, but this is a fixed 32-byte data map. This code works:

Byte data[32];   // data to write
TField *fp;
TBinaryField *bfp;
   fp = (TAdoQuery *)Q->FieldByName("map");
   bfp = dynamic_cast<TBinaryField *>(fp);

Although it works, the compiler is complaining about 'Accessing deprecated entity '_fastcall TField::SetData(void *,bool)' . The help for TField and TBinaryField is a little sketchy, with no examples. I can't find a method to write the data to this field using a simple Byte array (like data[]) - it calls for TByteDynArray.

Going down the TByteDynArray path is not helping - I can't seem to find any documentation about this object for CPPB in help or online...

I dont mind the 'deprecated entity' warning as long as the code works, but it does nag me. Anyone ?


Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02