Solved

Invalid BLOB handle in record buffer - error

Posted on 2004-03-21
6
1,060 Views
Last Modified: 2007-12-19
I have a problem with my code. I need to extract the text from the blob field of an Access database table.
I use a stringgrid (kStringGrid) where I want to push all the records of the table initial Access table. This table has a BLOB field which I cannot view unles I use a DBMemo. What I'm trying to do is take each record from the first to the last and save the fields I'm interested in to the stringgrid. I built a procedure to do that.
So my code  looks like this:


procedure upd_ann;
var
 data,s,p,u,stare:string;
 size:string;
begin
with form1 do
 begin
        q1.Active:=false;
        q1.Active:=true;
        q1.FindLast;
        u:=DBGrid1.Fields[0].AsString;
        q1.FindFirst;
        p:=DBGrid1.Fields[0].AsString;
        Memo3.Lines:=DBMemo1.Lines;
        If u<>p then
        repeat
                q1.FindNext;
                p:=DBGrid1.Fields[0].AsString; //field 1 (string)
                s:=Memo3.Lines.Strings[1];     //                                   FIELD 2 (comment) THE BLOB I NEED
                data:=DateTimeToStr(DBGrid1.Fields[2].AsDateTime);
                kStringgrid2.AddRow;
                kStringgrid2.Cells[1,kStringgrid2.Row]:=p;
                kStringgrid2.Cells[2,kStringgrid2.Row]:=s;
                kStringgrid2.Cells[5,kStringgrid2.Row]:=data;
        until u=p;
 end;


end;



Can anyone tell me what may be wrong about this. I read a few lines about this error but I could not solve my problem though. They wer about BLOB CACHE size... .
I'm sure I'm not the first that encounters this problem nor this error.
Any good code is welcome.
0
Comment
Question by:calinutz
  • 4
  • 2
6 Comments
 
LVL 11

Author Comment

by:calinutz
ID: 10657362
Yes... I forgot to mention that I use DBGrid1 to retrieve the dataset containing the blob field, and on the first column of the DBGrid there's the primary key. And then I use the DBMemo to view (and get) the BLOB.

Come on guys... there must be someone that encountererd this kind of situation before, I can't be the first.
0
 

Expert Comment

by:lbellego
ID: 10759454
Invalid blob handle appears when the BDE has not enought cache.
Use BDE Administrator and insert 400 to Blob Size and 1000 to Blob Cache.
We have this problem for doing repports with lots of blob and it's the solution...the problem is the BDE.
0
 
LVL 11

Author Comment

by:calinutz
ID: 10772126
Thanks, but: 'I read a few lines about this error but I could not solve my problem though. They wer about BLOB CACHE size...'. I already tryed that as I mentioned above and it seems that it still doesn't work.
Any other ideea?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Accepted Solution

by:
lbellego earned 85 total points
ID: 10774493
If I remember correctly, verify if the query component have RequestLive=False and if you can put Unidirectional=True (and read all the rows for the grid).
A blob can't be retreived by assignation and can't be assign with = (you can't use Field[2].AsBlob= something or retreive something with variable=FIelds[2].AsBlob). You have to use a stream or another thing to do that.
0
 
LVL 11

Author Comment

by:calinutz
ID: 10794326
Right now I'm installing Win 2003 Server on my comp and I have to reinstall Delphi and all the components and just after that I will be able to try your solution. It will probabely take a day or 2 to backup my files and all but as soon as I finish I promise you that I will try your solution. Maybe it will work.

Anyways... Happy Easter, and thank you for trying to answer my question , seems like noone else bothered.
0
 
LVL 11

Author Comment

by:calinutz
ID: 12918324
lbellego - I did not solve my problem but thanks for the interest in my problem though. Sorry for keeping you so long before giving you the points. I will try a workaround with my problem somehow.
Thanks anyway, and the points are yours for trying.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi - replicating a form 8 93
Tidtcpserver listening on multiports? 1 45
migrate this code to work on android 1 32
TlistView is Really heavy on Android 3 21
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question