Switch to: V10V9V8V7V6V5

VDatabase Class: Construction Methods

The VDatabase class constructor has two forms. The first one is for a LOCAL database and the second one is for a CLIENT database.

VDatabase()

Declaration:

VDatabase( inStorageType as EVStorageType = kDefault )

Parameters:

  • inStorageType - Storage type for this database

Declaration:

You should use this form of VDatabase constructor, if you create a database object that will work with a local database.

The parameter inStorageType specifies if the database is created on the DISK or in RAM. By default the database is disk-based.

Example:

db = new VDatabase
db = new VDatabase( EVStorageType.kRAM )

VDatabase()

Declaration:

VDatabase( inConnection as VConnection )

Parameters:

  • inConnection - VConnection object

Description:

You should use this form of VDatabase constructor to create a VDatabase object to access a remote database. The connection should be opened before.

Example:

connection = new VConnection( "somecompany.com", "sa", "sa" )
connection.Open()
 
remote_db = new VDatabase( connection )
remote_db.Open()
 
    ..................
 
remote_db.Close()
connection.Close()