How add MS Word or any other file to MS SQL?

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
gizmos
Posts: 5
Joined: Thu 03 Nov 2005 13:19

How add MS Word or any other file to MS SQL?

Post by gizmos » Thu 03 Nov 2005 13:31

How add MS Word or any other file to MS SQL? Can you exlain to simular Pictures Demos.

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Fri 04 Nov 2005 12:28

Do you mean adding data to server table? It is similar to images. Or do you mean displaying?

gizmos
Posts: 5
Joined: Thu 03 Nov 2005 13:19

Post by gizmos » Fri 18 Nov 2005 05:37

Yes adding any file to server table. Please give me any example.

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Fri 18 Nov 2005 13:35

Use something like this

Code: Select all

  MSQuery.Edit;
  BlobField := MSQuery.FieldByName() as TBlobField;
  BlobField.LoadFromFile(FileName);
  MSQuery.Post;

gizmos
Posts: 5
Joined: Thu 03 Nov 2005 13:19

Post by gizmos » Mon 28 Nov 2005 07:40

In MSSQL table's blobfield type is IMAGE. This time when running BlobField.LoadFromFile(FileName);
Giving me error.
Error was "Bitmap image is not valid."

What is my fault.

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 28 Nov 2005 10:56

This is TDBImage message. You should disconnect or delete this component to avoid the message.

gizmos
Posts: 5
Joined: Thu 03 Nov 2005 13:19

Post by gizmos » Tue 29 Nov 2005 04:57

Tnks, It works.

Post Reply