Dump/Restore Causes Crash With No Error...

Kimball Larsen kimball at kimballlarsen.com
Sun May 25 01:38:54 CDT 2003


Heya folks.. I'm fairly new to Valentina and very new to this list..  
but I'm stuck, and hope someone can help.
I have searched the list archives, but have not found a solution to my  
problem.  Here's some background.  I want to have a utilities section  
in my application that includes buttons for both backing up the current  
database and restoring a backup of a database.  I plan to use the xml  
format.  The backup/restore seems to work just fine (ie, I can backup  
to an xml file just fine, and the database restore function runs fine  
and does restore the database from the xml file.. ).  However - after I  
do a restore, as soon as I do anything else in my app that requires the  
database, the whole application quits, with no error message or warning.

Here is the code for my restore.  newDB is the existing global object  
that is of type VDatabase.

   dim dumpFile, dbFile as folderItem
   dim importedDB as VDatabase
   dim res as boolean
   newDB.close
   //newDB = nil
   dumpFile = getOpenFolderItem("????")
   dbFile = getFolderItem("db.vdb")
   dbFile.delete
   importedDB = new VDatabase
   importedDB.loadDump(dumpFile, dbFile, 2)
   importedDB.close
   importedDB = nil
   //newDB = new vdb
   dbFile = nil
   //res = newDB.open(dbFile)
   newDB.init("db.vdb")
   msgbox ("Database Restore Complete.")

As I said, the restore runs just fine, but it appears that there is  
some sort of a problem with newDB after the restore is done, because as  
soon as I try to use it, the whole app crashes.

Suggestions?  What am I doing wrong?

-- Kimball Larsen


------------------------------------------------------------------------ 
-----------------------
"Not everything that can be counted counts,
	and not everything that counts can be counted."
		- Albert Einstein



More information about the Valentina mailing list