calinutz
asked on
Invalid BLOB handle in record buffer - error
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].AsStr ing;
q1.FindFirst;
p:=DBGrid1.Fields[0].AsStr ing;
Memo3.Lines:=DBMemo1.Lines ;
If u<>p then
repeat
q1.FindNext;
p:=DBGrid1.Fields[0].AsStr ing; //field 1 (string)
s:=Memo3.Lines.Strings[1]; // FIELD 2 (comment) THE BLOB I NEED
data:=DateTimeToStr(DBGrid 1.Fields[2 ].AsDateTi me);
kStringgrid2.AddRow;
kStringgrid2.Cells[1,kStri nggrid2.Ro w]:=p;
kStringgrid2.Cells[2,kStri nggrid2.Ro w]:=s;
kStringgrid2.Cells[5,kStri nggrid2.Ro w]:=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.
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].AsStr
q1.FindFirst;
p:=DBGrid1.Fields[0].AsStr
Memo3.Lines:=DBMemo1.Lines
If u<>p then
repeat
q1.FindNext;
p:=DBGrid1.Fields[0].AsStr
s:=Memo3.Lines.Strings[1];
data:=DateTimeToStr(DBGrid
kStringgrid2.AddRow;
kStringgrid2.Cells[1,kStri
kStringgrid2.Cells[2,kStri
kStringgrid2.Cells[5,kStri
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.
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.
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.
ASKER
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?
Any other ideea?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
Anyways... Happy Easter, and thank you for trying to answer my question , seems like noone else bothered.
ASKER
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.
Thanks anyway, and the points are yours for trying.
ASKER
Come on guys... there must be someone that encountererd this kind of situation before, I can't be the first.