If (DB_Exists() eq 0) Then Print, 'ERROR: Database access not available' ; Create a new database object oDB = Obj_New('IDLdbDatabase') ; Set the Use_Cursor_Lib property (Needed for MS Access) oDB->SetProperty,/Use_Cursor_Lib ; Set the verbose property on to enable verbose error messages oDB->SetProperty,Verbose=1 ; Use dialogs to connect the object to a database connect = Dialog_DBConnect(oDB) ; To create a new table named ‘im_info’ use the SQL ; command ‘create table’: oDB->ExecuteSQL, $ "create table im_info (id integer, x integer," + $ "y integer, data image, name char(50))" ; Create a recordset object and connect to the table oRS = obj_new('IDLdbRecordSet', oDB, table='im_info') ; Add a record to the object. This record contains four ; fields that describe an image: the width of the image, ; the height of the image, the image data itself, and the ; name of the image. oRS->AddRecord, 1,400, 400, BYTSCL(DIST(400)), 'first image' ; Move the current the cursor position to the first row oRS->MoveCursor, /First ; Retrieve the information from this record into IDL ; variables X = oRS->GetField(1) ; Get the X size of image Y = oRS->GetField(2) ; Get the Y size of image image = oRS->GetField(3) ; Get the the image data name = oRS->GetField(4) ; Get the the image name ; Create an IDL window to display the image: Window,Title=name, XSize=x, YSize=y ;Display the image: TVScl, image ; Delete the im_info table and destroy the database ; objects Obj_Destroy, oRS oDB->ExecuteSQL, 'drop table im_info' Obj_Destroy, oDB End