Switch to: V9V8V7V6V5

Differences

This shows you the differences between two versions of the page.

valentina:products:adk:api:valentina_class:dbfilemethods [2017/02/04 06:45] (current)
Line 1: Line 1:
 +====== Valentina Class: Database File Methods ======
 +
 +===== Valentina. GetCurrentFormatVersion() =====
 +
 +**Declaration:**
 +
 +<code vb>
 +GetCurrentFormatVersion() as Integer
 +</code>
 +
 +**Description:**
 +
 +Returns the current format version of database file.
 +
 +**Example:**
 +
 +<code vb>
 +vers = Valentina.GetCurrentFormatVersion
 +</code>
 +
 +===== Valentina.GetDatabaseFormatVersion() =====
 +
 +**Declaration:**
 +
 +<code vb>
 +GetDatabaseFormatVersion( inVdbFile as FolderItem ) as Integer
 +</code>
 +
 +**Parameters:**
 +inVdbFile Path to the database file.
 +
 +**Description:**
 +
 +Returns the version of database file format. It can work even with a closed database.
 +
 +**Example:**
 +
 +<code vb>
 +dim fi as FolderItem
 +dim vers as integer
 +
 +fi = GetFolderItem( "MyDatbase.vdb" )
 +vers = Valentina.GetDatabaseFormatVersion( fi )
 +</code>
 +
 +===== Valentina.GetDatabaseMode() =====
 +
 +**Declaration:**
 +
 +<code vb>
 +GetDatabaseMode( inVdbFile as FolderItem ) as Integer
 +</code>
 +
 +**Parameters:**
 +  * **inVdbFile** - Path to the database file.
 +
 +**Description:**
 +
 +Returns the database mode. It can work even with a closed database.
 +
 +**Example:**
 +
 +<code vb>
 +dim fi as FolderItem
 +dim dbMode as integer
 +
 +fi = GetFolderItem( "MyDatbase.vdb" )
 +dbMode = Valentina.GetDatabaseMode( fi )
 +</code>
 +
 +
 +===== Valentina.GetIsStructureEncrypted() =====
 +
 +**Declaration:**
 +
 +<code vb>
 +GetIsStructureEncrypted( inVdbFile as FolderItem ) as Boolean
 +</code>
 +
 +**Parameters:**
 +  * **inVdbFile** - Path to the database file.
 +
 +**Description:**
 +
 +Returns TRUE if database structure is encrypted. It can work even with a closed database.
 +
 +**Example:**
 +
 +<code vb>
 +dim fi as FolderItem
 +dim isEncrypted as integer
 +
 +fi = GetFolderItem( "MyDatbase.vdb" )
 +isEncrypted = Valentina.GetStructureEncrypted( fi )
 +</code>
 +
 +===== Valentina.GetSchemaVersion() =====
 +
 +**Declaration:**
 +
 +<code vb>
 +GetSchemaVersion( inVdbFile as FolderItem ) as Integer
 +</code>
 +
 +
 +**Parameters:**
 +  * **inVdbFile** - Path to the database file.
 +
 +**Description:**
 +
 +Returns the version of database schema. It can work even with a closed database.
 +
 +**Example:**
 +
 +<code vb>
 +dim fi as FolderItem
 +dim SchemaVersion as integer
 +
 +fi = GetFolderItem( "MyDatbase.vdb" )
 +SchemaVersion = Valentina.GetSchemaVersion( fi )
 +</code>
 +
 +===== Valentina.SetExtensions() =====
 +
 +**Declaration:**
 +
 +<code vb>
 +SetExtensions(
 +    inDesc as String,
 +    inDat as String,
 +    inBlb as String,
 +    inInd as String)         
 +</code>
 +
 +**Parameters:**
 +  * **inDesc** - Extension for description file (.vdb)
 +  * **inDat** - Extension for data file (.dat)
 +  * **inBlb** - Extension for BLOB file (.blb)
 +  * **inInd** - Extension for indexes file (.ind)
 +
 +**Description:**
 +
 +You can call this function before opening or creating a database to inform the Valentina kernel which extensions it should use for database files. If you do not explicitly call this method, then the standard four extensions are used by default. If you do use this method, you should explicitly include all extensions that you want to be supported in your database application.
 +
 +Note: The four standard file types of a Valentina database are explained in full in the ValentinaKernel.pdf.
 +
 +The first example shows explicitly setting the standard extensions in a four file database.
 +
 +The second example shows a database in which two files are created:
 +  * the description database file using its standard extension;
 +  * the index file with a custom file type of .tre instead of its standard extension, .ind.
 +
 +**Example:**
 +
 +<code vb>
 +Valentina.SetExtensions( "vdb", "dat", "blb", "ind" )
 +
 +Valentina.SetExtensions( "vdb", "", "", "tre" )
 +</code>