Product: | Platform: | Area: | Version: |
INM V12 Database for Director |
Windows, Macintosh |
Opening & closing database objects |
Version 3.3.3- 3.4 |
Summary
Up until Director MX 2004, simply setting the database and table instance variables to zero would close and destoy those global instances. However, in Director MX 2004 on Windows, the global instances of variables are not destroyed properly when they are set to zero.
This becomes a problem if your application has to close and then reopen database objects at a later point, because the database and tables are locked and V12 generates errors:
-1380: Unable to create or modify a database on a locked file or volume.
OR
-1910: File does not exist or is already open.
Solution
To resolve this issue a new method, mClose(), has been added to version 3.3.3 of INM V12 Database to explicitly close and destroy those global instances. To properly close a V12 table or database, first call the mClose() method with its global instance variable as a parameter; then set that reference variable to 0.
Always make sure to dispose of all V12table instances before you dispose of the V12dbe instance that contains them.
Example:
-- This is a complete example of a script that would run on StopMovie
on StopMovie
global gDB, gTable
if ObjectP(gTable) then
gTable.mClose()
gTable=0
end if
if ObjectP(gDB) then
gDB.mClose()
gDB=0
end if
end StopMovie