jackrabbithanna
Programmer
I'm creating a program to manage a database of invoices. Each invoice will have a parts list. The parts list has part number,price, quantity etc... I'm using a string grid to display and edit this data. The problem is how to store the strings in a single binary field in a paradox table. I've been playing with TBlobStreams and other streams but I can't get it right. I don't even know if its possible to store an array of strings in a single field. Any pointers or strategies would be appreciated. Here's the (unworkable) code I got so far: It compiles but gives an StreamError exception when executed
TMemoryStream *pns = new TMemoryStream;
TStream *pndatas ;
pndatas=dataMod->Invoice->CreateBlobStream(dataMod->Invoice->FieldByName("PartsList"),bmReadWrite);
lbPartNumber->Items->SaveToStream(pns);
pndatas->CopyFrom(pns,pns->Size);
delete pns;
delete pndatas;
dataMod->Invoice->Post();
TMemoryStream *pns = new TMemoryStream;
TStream *pndatas ;
pndatas=dataMod->Invoice->CreateBlobStream(dataMod->Invoice->FieldByName("PartsList"),bmReadWrite);
lbPartNumber->Items->SaveToStream(pns);
pndatas->CopyFrom(pns,pns->Size);
delete pns;
delete pndatas;
dataMod->Invoice->Post();