geomagas
User
 Fresh Boarder
| Posts: 3 |   | Karma: 0 |
|
CreateBlobStream problem?
|
|
Posted: 2007/09/25 05:42 |
|
|
|
|
Hello, I have this piece of code in my app.
With TADQuery.Create(Self) do
Begin
Connection:=someADConnection;
SQL.Text:=someQuery; // returns 1 row
Open;
bs:=CreateBlobStream(FieldByName('CONTENT'),bmWrite);
With bs do
Begin
Write(Body,SizeOf(Body));
Free;
end;
Close;
Free;
End;
|
bs is a TStream and Body is a String.
When, at runtime, execution reaches bs:=CreateBlobStream(FieldByName('CONTENT'),bmWrite), it raises an "Invalid typecast".
Which BTW is not the case when I use i.e. TADOQuery etc.
I tried to figure out what's wrong, but no luck so far...
Any ideas?
Magafourakis George
TEI of Crete
Greece
|
|