Upload file to MSSQL database

xiaoxiao2021-03-06  50

VAR

TadoQuery;

Stream: tmemorystream;

Begin

Query: = tadoquery.create (nil);

Query.Close ();

Query.sql.add ('select * from a');

Query.open ();

IF (Query.Recordcount> 0) THEN Begin

Query.edit ();

Stream: = TMEMORYSTREAM.CREATE ();

Stream.LoadFromfile (FilePath);

TBLOBFIELD (Query.fieldByname ('pphoto')). LoadingFromstream (stream);

Freeandnil (stream);

Query.post ();

END;

Query.Close ();

Freeandnil (Query);

转载请注明原文地址:https://www.9cbs.com/read-109769.html

New Post(0)