10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

How You Can Work with Images5. Add the current value of the DBHandle attribute to your database table sothat you can access the image the next time you need it.6. Commit the changes to the database.The image is now stored in the database. You can display the image by settingthe DBHandle attribute, and you can replace or delete the image, if necessary,with the UpdateInDB or DeleteFromDB methods, respectively.For a description of updating images in the database, see Update Bitmaps in aDatabase (see page 285). For more information about error handling for theInsertIntoDB method, see Working with a Database (see page 147).Note: Do not use these database methods for BitmapObjects with autocommitturned on because the multiple database statements involved in accessing theBitmapObject data can produce incorrect results.How You Can Display a Bitmap from a DatabaseUpdate Bitmaps in a DatabaseTo display an image stored in a database, use the DBHandle attribute of thebitmap object that is associated with the image field. Set the value ofBitmapObject's DBHandle attribute to the value of the DBHandle for theparticular image.To remove an image from the database, use the DeleteFromDB method. TheDeleteFromDB method deletes the image that has the current value ofDBHandle attribute.To delete a bitmap from a database1. Set the value of the DBHandle attribute to the DBHandle for the image youwant to delete.2. Use the DeleteFromDB method to remove the image.3. Commit the changes to the database.The DeleteFromDB method returns ER_OK if successful or a nonzero value ifthere is an error.For more information about error handling for the DeleteFromDB method, seeWorking with a Database (see page 147).How You Can Create a Bitmap Storage TableTo store bitmaps in a database, use OpenROAD to add them to a table.OpenROAD automatically creates a special bitmap storage table, calledii_stored_bitmaps. You can also create your own storage table.Working with Images and Text Strings 285

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!