Switch to: V12V11V10V9V8V7V6V5

VTable Class: Properties

VTable.CollationAttribute

CollationAttribute( inColAttribute as EVColAttribute ) as EVColAttributeValue

The value of the specified collation attribute for this table.

dim v as integer
v = table.CollationAttribute( EVColAttribute.kStrength )
 
table.CollationAttribute( EVColAttribute.kStrength ) = EVColAttributeValue.kPrimary

VTable.Database

Database as VDataBase (r/o)

Returns the database of this table.

db = table.Database

VTable.FieldCount

FieldCount as Integer (r/o)

Returns the number of the user-defined fields in the table.

For example, say you define “CREATE TABLE T1(f1 LONG, f2 LONG METHOD '-f1')”. Now you have defined two fields, one of them, f2 - is a calculated field (Table Method). The VTable.FieldCount property, in this case, will return the result of 2. Note that VTable.FieldCount will NOT count the internal fields of table T1, which are RecID and OID.

fldCount = table.FieldCount

VTable.ID

ID as Integer (r/o)

Returns the unique identifier of the table. A Table has its own unique identifier inside the database. In most cases, this property is used internally by Valentina kernel.

id = table.ID

VTable.IndexChanges

IndexChanges as Boolean (r/o)

This property can improve the speed of massive operations on the table: inserts (as well as import), deletes, updates.

When you set this property to FALSE, the Table trash all not unique indexes and remember this state in the flag. So a field still has flag Indexed, but index file itself trashed. From now, insert/delete/update operations will not spend time on that indexes. Unique index(es) of the Table (if any exists) still will be maintained.

When you set this property back to TRUE, the Table clears the state in the flag and force Reindex of all dropped indexes.

Note, that if you use a language which can handle exceptions, it is considered as a good practice to use try/catch statements around massive changes in order to be able to reset the property to TRUE.

Check the details about this feature in the Performance Guide: Disable Indexes of Table

tbl.IndexChanges = false
 
  try
  {
      // do some massive changes
  }
  catch
  {
      tbl.IndexChanges = true
  }
 
  tbl.IndexChanges = true

VTable.IsEncrypted

IsEncrypted as Boolean (r/o)

Returns TRUE if the database is encrypted.

encrypted = table.IsEncrypted

VTable.KeyValueCount

Declaration:

KeyValueCount as Integer (r\o)

Description:

Returns the count of KeyValuesForTable in this table. This property is indirectly changed when you create/drop a KeyValue object.

Example:

count = tbl.KeyValueCount

VTable.LinkCount

LinkCount as Integer (r/o)

Returns the number of links in the table.

dim LinkCount as Integer
LinkCount = table.LinkCount

VTable.LocaleName

LocaleName as String

Specifies the locale name for this table.

dim LocaleName as String
LocaleName = table.LocaleName
 
table.LocaleName = "en_US"
table.LocaleName = "jp_JP"

VTable.MaxRecordCount

MaxRecordCount as Integer

NOT IMPLEMENTED.Will allows optimizing Valentina Links by storage size and performance.

 

VTable.Name

Name as String

Each Table has a unique Name in the scope of a database. The Name is case-insensitive.

dim sname as string
 
sname = table.Name
table.Name = "NewName"

VTable.OID

OID as ULong Long

Returns the OID of the current record.

oid = tblPerson.OID

VTable.PhysicalRecordCount

PhysicalRecordCount as Integer (r/o)

Returns the numbers of physical records in the table. Physical records include both existing records and previously deleted records.

physRecCount = table.PhysicalRecordCount

VTable.RecID

RecID as Integer

Returns the RecID of the current record. The range of values is 1..N, 0 - if the current record is undefined. Also, you can use this property to change the current record of the Table. In case you try to move to a non-existing record the current record will not be changed.

recID = Table.RecID
 
Table.RecID = RecID			// move to specific record
Table.RecID = 54			// move to specific record
 
Table.RecID = Table.recID + 1		// move to next record
Table.RecID = Table.recID - 1		// move to prev record

VTable.RecordCount

RecordCount as Integer (r/o)

Returns the number of logical records in the table.

If there are no deleted records, then the number of logical records is equal to the number of physical records. Otherwise VTable.Recordcount will be less than the number of physical records.

rcdCount = table.RecordCount

VTable.StorageEncoding

StorageEncoding as String

Specifies for this table the encoding of strings stored in the disk file.

dim Encoding as String
Encoding = table.StorageEncoding
 
table.StorageEncoding = "UTF-16"