AW: VDataBase_IsOpen( gDBRef ) fails

Tiemo Hollmann TB toolbook at kestner.de
Tue Dec 15 01:53:59 CST 2009


Hello Ruslan,

my code for opening the DB looks like this (I stripped all error handling)

if (not VDataBase_IsOpen( gDBRef ) ) then		<<< at first start
gDBRef is
empty, but I works on
most machines!?
   get Valentina_Init( foo )
   put VDatabase_Constructor() into gDBRef
   get VDataBase_SQLExecute( gDBRef,"SET PROPERTY WarningMode TO FALSE")
   get VDatabase_UseEncryptionKey( gDBRef, foo, "kStructureAndRecords"  )
   get VDatabase_Open( gDBRef, tDbPath )
   get VDatabase_DateFormat( gDBRef, "kYMD" )
   get VDatabase_DateSep( gDBRef, "." )
   if the platform = "MacOS" then
      get VDatabase_IOEncoding( gDBRef, "Macintosh" )
   else
      get VDatabase_IOEncoding( gDBRef, "Latin1" )
   end if
   get VDataBase_SQLExecute( gDBRef, "REINDEX DATABASE" )	<<< I added
it on 									your
advice, because
of Index errors
end if

I think I will just delete the first _IsOpen_ condition, because actually I
don't need it, I open it anyhow only once, so I can start with
Valentina_Init() and I will see if it fails then at Valentina_Init()

I just see that my "SET Property WarningMode" is set before I have opend the
DB. Is this correct or is it just ignored and I have to put it after
opening?

What is the difference between your proposal VDatabase_New and my
VDatabase_Constructor()?

Thank you for coaching
Tiemo



> This NOT sounds like not loaded DLL of Valentina BECAUSE
> In this case you'd have fail on first call Valentina_Init()
> But you have come to VDatabase_IsOpen() ...
> 
> 
> Please show this part of code
> 
>     gdbRef = VDatabase_New
> 
>     VDatabase_IsOpen( gDbRef )  <<<< I wonder -- at this point gbRef
>                                         don't know path ?
> 
>     VDatabase_Open( path )
> 
> 



More information about the Valentina mailing list