Stuart_Johnson
asked on
CreateBlobStream Question
Hi.
I need to save some binary files within a Paradox 7 database. I have created the database using the Database desktop and set the field type as Binary. However, when I try to copy the file into the Binary field, I get a stream write error.
Here's the code I am using:
Var stmData: TStream;
stmFile: TFileStream;
begin
stmFile := TFileStream.Create('C:\COM MAND.COM', fmOpenRead);
stmData := tbProducts.CreateBlobStrea m(tbProduc ts.FieldBy Name('Data '), bmReadWrite);
tbProducts.Append;
stmData.CopyFrom(stmFile, stmFile.Size);
tbProducts.Post;
stmData.Free;
stmFile.Free;
End;
What am I doing wrong??
Thanks for any help,
Stu.
I need to save some binary files within a Paradox 7 database. I have created the database using the Database desktop and set the field type as Binary. However, when I try to copy the file into the Binary field, I get a stream write error.
Here's the code I am using:
Var stmData: TStream;
stmFile: TFileStream;
begin
stmFile := TFileStream.Create('C:\COM
stmData := tbProducts.CreateBlobStrea
tbProducts.Append;
stmData.CopyFrom(stmFile, stmFile.Size);
tbProducts.Post;
stmData.Free;
stmFile.Free;
End;
What am I doing wrong??
Thanks for any help,
Stu.
Hi Stu,
In which one you get an error? Command.com could be locked so may be we may use
TFileStream.Create('C:\COM MAND.COM', fmOpenRead or fmShareDenyNone);
or
TFileStream.Create('C:\COM MAND.COM', fmOpenRead or fmShareCompat);
igor
In which one you get an error? Command.com could be locked so may be we may use
TFileStream.Create('C:\COM
or
TFileStream.Create('C:\COM
igor
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks menxin, I am honestly not with it today. I can't believe I overlooked that!
Working wonderfully now!
Stu.
Working wonderfully now!
Stu.
ASKER