Subject | AV for CreateBlobStream: second post, this time with simple test |
---|---|
Author | ifitsx |
Post date | 2012-01-20T23:55:08Z |
I've been using v4.2Hd for many years now, not needing elaborate functionality.
However, I have now upgraded to Win7 x64 and DEX2, so I'm trying to move my few apps over.
I'me getting an AV when I try to create a readonly blobstream, however, writeonly works well: Kind of an unusual contradiction.
Rather than presume there is something complex amuck in my app, here's a simple test using only an IBODatabase and an IBOQuery that I'm now running on Win7 x64 and DEX2, and IB v4.9.14.b35, almost the exact update source.
Practically everyone should have some db (I'm still using Firebird 1.5.6, wanting to get the 'simple stuff' taken care of before moving to 2.5x) that has any stringfield and a blob - mine's a memofield.
So, take an IBODatabase and an IBOQuery, connect it to any db with a string field and, preferably a memofield - that's what's at issue for me - and try to run this, and hopefully tell me why it doesn't work for me:
procedure TForm1.FormActivate(Sender: TObject);
begin
qryTestBlob.Close;
qryTestBlob.Open;
edt1.Text := qryTestBlob.FieldByName('Subject').AsString;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
qryTestBlob.Close;
dbTestBlob01.Connected := False;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
dbTestBlob01.Connected := True;
end;
procedure TForm1.GetBlobClick(Sender: TObject);
var
BlobStrmLoad: TStream;
begin
BlobStrmLoad := nil;
if qryTestBlob.Active then
begin
try
qryTestBlob.Next;
if NOT qryTestBlob.FieldByName('SUBJECT').IsNull then
begin
BlobStrmLoad := qryTestBlob.CreateBlobStream(qryTestBlob.FieldByName('NOTES'), bmRead);
edt1.Text := qryTestBlob.FieldByName('Subject').AsString;
end;
finally
if Assigned(BlobStrmLoad) then
FreeAndNil(BlobStrmLoad); end;
end; // if qryTestBlob.Active
end;
CreateBlogStream returns, on my system, the ?standard AV, $C0000005.
Yet under 4.2Hd, it works perfectly.
??
Barry
However, I have now upgraded to Win7 x64 and DEX2, so I'm trying to move my few apps over.
I'me getting an AV when I try to create a readonly blobstream, however, writeonly works well: Kind of an unusual contradiction.
Rather than presume there is something complex amuck in my app, here's a simple test using only an IBODatabase and an IBOQuery that I'm now running on Win7 x64 and DEX2, and IB v4.9.14.b35, almost the exact update source.
Practically everyone should have some db (I'm still using Firebird 1.5.6, wanting to get the 'simple stuff' taken care of before moving to 2.5x) that has any stringfield and a blob - mine's a memofield.
So, take an IBODatabase and an IBOQuery, connect it to any db with a string field and, preferably a memofield - that's what's at issue for me - and try to run this, and hopefully tell me why it doesn't work for me:
procedure TForm1.FormActivate(Sender: TObject);
begin
qryTestBlob.Close;
qryTestBlob.Open;
edt1.Text := qryTestBlob.FieldByName('Subject').AsString;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
qryTestBlob.Close;
dbTestBlob01.Connected := False;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
dbTestBlob01.Connected := True;
end;
procedure TForm1.GetBlobClick(Sender: TObject);
var
BlobStrmLoad: TStream;
begin
BlobStrmLoad := nil;
if qryTestBlob.Active then
begin
try
qryTestBlob.Next;
if NOT qryTestBlob.FieldByName('SUBJECT').IsNull then
begin
BlobStrmLoad := qryTestBlob.CreateBlobStream(qryTestBlob.FieldByName('NOTES'), bmRead);
edt1.Text := qryTestBlob.FieldByName('Subject').AsString;
end;
finally
if Assigned(BlobStrmLoad) then
FreeAndNil(BlobStrmLoad); end;
end; // if qryTestBlob.Active
end;
CreateBlogStream returns, on my system, the ?standard AV, $C0000005.
Yet under 4.2Hd, it works perfectly.
??
Barry