How to store data in BINARY field
Posted: Wed 06 Feb 2008 12:47
I have BINARY field in the table.
`TAG` binary(12) NOT NULL
How I can store bytes from array of bytes in this field?
Followed code work but on `TAG` field data not stored.
tag contain right data.
Help me please!
Alex
`TAG` binary(12) NOT NULL
How I can store bytes from array of bytes in this field?
Followed code work but on `TAG` field data not stored.
tag contain right data.
Code: Select all
Variant tag = VarArrayCreate(Bounds, 1, varByte);
for(int i=0;iSQL->Add("INSERT INTO `alnetdb`.`pc_product_log` ( \ `TAG`, `DT`, `STATION_ID`, `ENTRY_FLAG`) VALUES (:tag, :dt, :station_id, :entry_flag);");
pQuery->Params->ParamByName("tag")->DataType = ftBytes;
pQuery->Params->ParamByName("tag")->Size = RFID_TAG_LEN;
pQuery->Params->ParamByName("tag")->Value = tag;
pQuery->Params->ParamByName("dt")->AsDateTime = dtDate;
pQuery->Params->ParamByName("station_id")->AsInteger = station->StationID;
pQuery->Params->ParamByName("entry_flag")->AsBoolean = GetControlPointDirection(station->StationID);
pQuery->Execute();
pQuery->Close();Alex