Board index » delphi » retrieving blob fields from MS SQL 6.5

retrieving blob fields from MS SQL 6.5

Hi,
     I am trying to retrieve a blob field from a table in MS SQL 6.5. I
create
first a  TBlobStream object where the code looks something like this:

myBlobStream : TStream;

myBlobStream := TBlobStream.Create(myBlobField, fmRead);

myBlobField is the blob Field is the blobField i want to retrieve.

Is it possible to retrieve a blob field from MS SQL in this manner ?. I know
that from an Interbase server there is no problem.

thanks
Ricardo

 

Re:retrieving blob fields from MS SQL 6.5


Maybe, it could help you. Here, i use an array of byte and a binary field in
SQL6.5 ( and SQL7 )

const
  MaxLenArray=100;

var
  MyByteField: TBytesField;
  MyArrayOfByte: array[0..MaxLenArray] of byte;

To read data from a binary field in SQL6.5 :

  MyByteField.GetData(@MyArrayOfByte);

To Write data to a binary field in SQl 6.5

With MyByteField :

  MyByteField.SetData(@MyArrayOfByte);

With an insertion request with parameters,MyBinaryField is a parameter
declared as a BlobField.

Query.ParamByName('MyBinaryField').SetBlobData(@MyArrayOfByte,MaxLenArray);

bye,
  Ben

Other Threads