Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error reading database blob stream

Status
Not open for further replies.

jackrabbithanna

Programmer
Aug 19, 2004
11
0
0
US
I'm storing 4 different lists in a Paradox table using a TTable component. Each list has its own blob field. I have no problem saving each list to its field but when I try to retrieve the lists later I recieve an error : "EDBEngine Error with message 'Blob not opened'". But if I step over this error the other 3 lists will load without error. Does anyone know why this is happening? Thanks,

Code:
TStream *partnums = dataMod->Invoice->CreateBlobStream(dataMod->Invoice->FieldByName("PartsList"),bmRead);
TStream *partnames = dataMod->Invoice->CreateBlobStream(dataMod->Invoice->FieldByName("PartsNamesList"),bmRead);
TStream *partprices = dataMod->Invoice->CreateBlobStream(dataMod->Invoice->FieldByName("PartsPriceList"),bmRead);
TStream *partquantitys = dataMod->Invoice->CreateBlobStream(dataMod->Invoice->FieldByName("PartQuantityList"),bmRead);
lbPartNumber->Items->Clear();
lbPartNumber->Items->LoadFromStream(partnums);

Error right here !!!!
EDBEngineError with message can't open blob field;
I think the strings are there because if I step over the the other three lists are populated without error. Strange...


lbName->Items->Clear();
lbName->Items->LoadFromStream(partnames);
lbPrice->Items->Clear();
lbPrice->Items->LoadFromStream(partprices);
lbQuantity->Items->Clear();
lbQuantity->Items->LoadFromStream(partquantitys); */
 
You're really going to hate this...

TStream *partnums = dataMod->Invoice->CreateBlobStream(dataMod->Invoice->FieldByName("[highlight]PartsList[/highlight]"),bmRead);

lbPartNumber->Items->LoadFromStream([highlight]partnums[/highlight]);
 
I don't understand what you're trying to say. The field name in the database is named PartsList, a binary field. The variable I use at runtime to access this field is partnums. This is because I want to store the part numbers in the parts list. Am I missing a simple point?
 
Oops... Uh, it was kinda late when I posted that... sorry.
 
My recommendation is to set a breakpoint right before that first CreateBlobStream call. Put a "watch" on partnums and the items property of lbPartNumber. Step into the code and see if it does anything unusual.

Another thought, swap the lines of code around so partnums is the second or third step. That will show you if it's directly related to partnums.
 
I've tried swiching the order and no matter what order I attempt to load the streams the FIRST attemp prompts the error. This is strange. Its like the database doesn't "open up" fast enough. I"m fairly new at using the BDE so I'm not profient in all the incricicies.

Any way I'm using a workaround for the time being. I'm using DBMemo instead of TListBox to store the lists. It has got me closer to the solution I desire but it has differnt problems. I'd still like to know why the first stream loaded produces an error. Thanks for your help.
 

"I'm using DBMemo instead of TListBox to store the lists."

I dont know but this line throws a fflag up for me.

2ffaT, what do you think.

at the risk of sounding stupid I will say that Tlistbox
is not a blob. and you are trying to mingle blob and
stringlist

I know it was stupid

tomcruz.net
 
I've religiously avoided BLOATS...er...BLOBs. I always deal with strings separately. I don't understand why jackrabbithanna wanted to use them in the first place. Thats why I've never replied to this thread.


James P. Cottingham
-----------------------------------------
[sup]To determine how long it will take to write and debug a program, take your best estimate, multiply that by two, add one, and convert to the next higher units.[/sup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top