Introduction: Database Interaction

With LEADTOOLS, you can use a variety of strategies to maintain images in a database. This variety is necessary because of the uneven support for storing images using different development and database systems.

You may be able to use ODBC (Open Database Connectivity). ODBC is a standard interface for accessing local and remote databases. To use it, you define a data source that is implemented with an ODBC driver; then you access the data source in the same way you would a local database. LEADTOOLS provides COM methods and properties that let you directly access image data through an ODBC data source. There are a couple of limitations in this approach. First, since the ILEADRasterODBC COM accesses the image data directly and does not access any other data in the record, you must deal with the problem of identifying the image. To solve this problem, you can use another means of selecting records; then synchronize the ILEADRaseterView COM to view, so that it is always accessing the same record. (The COM tutorials describe how to do this.) The second limitation is with ODBC drivers. Most of the available ODBC drivers do not properly support access to long binary fields.

Also, for systems with COM support, you can use OLE DB and ADO to access data. You can bind the LEADTOOLS OLE Raster DB Control to an OLE DB data source, such as the Microsoft ADO Data Control. You can associate the LEADTOOLS OLE Raster DB Control with a long binary field in the database, and let the data control handle all of the database maintenance and navigation.

A more flexible approach on lower-level development systems, such as C, and C++ is to use the ability of LEADTOOLS to save a file in memory. Once the image is available in memory in a compressed file format, you can use your choice of database engines to store and retrieve the data.

Finally, you may want to consider using your computer's or network's file system to store the images, use a database to store the file paths as strings, and write your own code to do the synchronization. In some cases, this could be a better solution than storing the images directly in the database.