How to recover a db after app crashes?

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Oct 13 11:48:25 CDT 2008


On 10/13/08 5:36 PM, "Tiemo Hollmann TB" <toolbook at kestner.de> wrote:

Hi Tiemo, 
 
> When my RunRev app with an encrypted db crashes on Win and I want to restart
> I get an error when trying to open the db that "Object is not encrypted".
> What I coded is:
> 
>         -- initialising here
> 
>         get VDatabase_Open( gDBRef, tDbPath )
> 
>         if VDatabase_ErrNumber(mDBRef) = 398594 then
> 
>             get VDatabase_UseEncryptionKey( gDBRef, MyKey,
> "kStructureAndRecords"  )
> 
>             get VDatabase_Open( gDBRef, tDbPath )
> 
>         end if
> 
>         if VDatabase_ErrNumber(gDBRef) is not "0" then
> 
>             answer "DB could not be opened" && VDataBase_ErrString(gDBRef)
> 
>         end if
> 
>         if( VDatabase_IsEncrypted( gDBRef ) ) and
> (VDataBase_IsStructureEncrypted( gDBRef )) then
> 
>             get VDatabase_Decrypt ( gDBRef, MyKey, "kStructureAndRecords" )

You should not DECRYPT db here!!

You have inform engine about KEY above.
Now engine when load something from db will decrypt it in RAM self.


Function get VDatabase_Decrypt () is required only if you want REMOVE
decryption at all from db. You see?


>         end if
> 
>   
> 
> The VDataBase_ErrString(gDBRef) tells me "Object is not encrypted" though I
> first try to open without using encryption key.
> 
> What is the correct way to handle opening a crashed db?
> 
> Are there any "recovery" commands for crashed Apps/DBs? And if yes, how to
> use them? How are your approaches on this?

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list