![]() ![]() By default, the FetchOnDemand property of the ClientDataSet is set to True. On the ClientDataSet side, I call the function CreateBlobStream to obtain a stream for writing data to the BLOB field. I use streams to read from a source file and write the result into a BLOB data field. Since I do not need any undo functionality or have to apply against a database server, I have turned off logging with the LogChanges property to conserve system resources. Two are of type ftBlob and will hold our BLOBs, and two others are of type ftString to hold the associated file names. I created five fields, using the Field Editor of the ClientDataSet. You will be able to store these BLOBs and to restore them to a specified location on your drive. The record will also store the associated file names. In addition, it will have the option to store another BLOB in the same record, such as an executable, or a MS Word document. The example will store a BMP image as a BLOB and display it in the application. Note that not all databases support BLOBs. You can use any database that supports BLOBs, such as SQL Server or Oracle. Image shown above is also stored as a BLOB in the same record.įor our purposes, I will use a TClientDataSet to create a custom local database to store our BLOBs. ![]() The zip fileĬontains the full source code, executable and database file that make up this project! Of a zip file that is stored as a BLOB in the same record. SOURCE CODE PROGRAM DATABASE DELPHI HOW TOThis example shows you how to work with BLOBs using Delphi. This example will show you how you can use Delphi to store BLOBs in a database and restore them to disk on demand. However, they can also be used to hold other types of data, such as executables, zip files, code and documents. BLOBs are usually used to hold digitized multimedia content such as images, sound clips and videos. Working With BLOBs Using Delphi What is a BLOB?īLOB is an acronym that stands for Large Binary Object, which is a collection of binary data stored in a data field in a database that supports this functionality. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |