Board index » delphi » ADo, MS SQL 2000 and Parameters

ADo, MS SQL 2000 and Parameters

Parameters.ParamByName('DATA').LoadFromFile(sFile,ftBlob);

MH

 

Re:ADo, MS SQL 2000 and Parameters


Quote
> Parameters.ParamByName('DATA').LoadFromFile(sFile,ftBlob);

Hi Marius,

I don't have a file :) ... And I don't want to create a file either...

btw, LoadFromFile simply calls LoadFromStream after creating a
TFileStream...

Here, this is from AdoDB:

procedure TParameter.LoadFromFile(const FileName: string; DataType:
TDataType);
var
  Stream: TStream;
begin
  Stream := TFileStream.Create(FileName, fmOpenRead);
  try
    LoadFromStream(Stream, DataType);
  finally
    Stream.Free;
  end;
end;

And why the message "String or binary data would be truncated"?

--
Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com

Upscene Productions
http://www.upscene.com

"This is an object-oriented system.
If we change anything, the users object."

Re:ADo, MS SQL 2000 and Parameters


Try ftBlob instead of ftVarBytes.

MH

Re:ADo, MS SQL 2000 and Parameters


Thanks - it seems to work fine now...

--
Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com

Upscene Productions
http://www.upscene.com

"This is an object-oriented system.
If we change anything, the users object."

"Marius Horak" < > wrote in message news:3d6100d6$1@dnews...

Quote
> Try ftBlob instead of ftVarBytes.

> MH

Other Threads