Home > Language Reference > Classes

DatabaseInfo Class

  + Object
    + DatabaseInfo

Description

The DataBaseInfo object implements the methods and properties that read or modify the characteristics of a database. It can also enumerates all the databases stored in the handheld device, with methods such as FindFirstByTypeCreator, FindByName and FindNext.

The following example shows how to enumerate all the applications on the handheld device using FindFirstByTypeCreator function, then fill a list ( List1 ) with them. Each time the user click an item, a second list ( List2) display all the related properties of the selected database:

Dim MyCollection as New Collection

Private Sub Form_Load()
  Dim found as Boolean
  Dim d as new DatabaseInfo
  Dim di as New DatabaseInfo
  dim i as Integer
  
  found = di.FindFirstByTypeCreator("appl","")
  While found
    MyCollection.Add clone(di)
    found = di.FindNext
  Wend

  List1.Redraw=False
  For i=1 to MyCollection.Count
    set d=MyCollection.Item(i)
    List1.AddItem d.Name & "(" & d.Creator & ")"
  Next i
  List1.Redraw=True
End Sub

Private Sub List1_Change()
  dim d as databaseinfo
  set d=MyCollection.Item(list1.ListIndex+1)
  List2.Redraw=False
  List2.Clear
  List2.AddItem "Name:" & d.Name
  List2.AddItem "AttrBackup:" & d.AttrBackup
  List2.AddItem "AttrBundle:" & d.AttrBundle
  List2.AddItem "AttrCopyPrevention:" & d.AttrCopyPrevention
  List2.AddItem "AttrHidden:" & d.AttrHidden
  List2.AddItem "AttrInstallNewer:" & d.AttrInstallNewer
  List2.AddItem "AttrOpen:" & d.AttrOpen
  List2.AddItem "AttrReadOnly:" & d.AttrReadOnly
  List2.AddItem "AttrRecyclable:" & d.AttrRecyclable
  List2.AddItem "AttrResetOnInstall:" & d.AttrResetOnInstall
  List2.AddItem "AttrResourceDB:" & d.AttrResourceDB
  List2.AddItem "AttrStream:" & d.AttrStream
  List2.AddItem "BackedUp:" & d.BackedUp
  List2.AddItem "Created:" & d.Created
  List2.AddItem "Creator:" & d.Creator
  List2.AddItem "ModificationNumber:" & d.ModificationNumber
  List2.AddItem "Modified:" & d.Modified
  List2.AddItem "RecordCount:" & d.RecordCount
  List2.AddItem "Size:" & d.Size
  List2.AddItem "Type:" & d.Type
  List2.AddItem "Version:" & d.Version
  List2.Redraw=True
End Sub

The following screenshot show the main form of this sample:

Members

MembersDescription
AppInfoBlock Database application info block.
AttrBackup Indicates if the database is saved during each synchronization.
AttrBundle Indicates if the database is linked to an application.
AttrCopyPrevention Indicates if the database can be copied.
AttrHidden Indicates if the database is visible.
AttrInstallNewer Indicates if the database can be replaced if it is opened while the synchronization process starts.
AttrOpen Indicates if the database is open.
AttrReadOnly Indicates if the database is in read only access mode.
AttrRecyclable Indicates if the database is temporary.
AttrResetOnInstall Indicates if the handheld device should restart after the installation of a database.
AttrResourceDB Indicates if the database is a resource database.
AttrStream Indicates if the database is a stream database.
BackedUp Indicates the date of the last backup of a database.
CardNumber Card number on which a database reside.
Created Indicates the creation date of a database.
Creator Indicates the Creator of a database
Delete Delete a database.
FileSize Size of the database when it is serialized.
FindByName Search for a database from its name.
FindFirstByTypeCreator Begin enumerating the databases that have a certain type and/or creator.
FindNext Continues a database enumeration initiated by FindFirstByTypeCreator.
LocalID Local identifier of a database.
ModificationNumber Indicates the number of modifications carried out on the database.
Modified Last modification date.
Name Database name.
RecordCount Number of records in the database.
ROM Indicates whether a database resides in ROM or not.
Shell Launches an application.
Size Size of the database in the storage heap.
SortInfoBlock Database sort info block.
Type Database type.
Version Database version number.
Inherited from ObjectDescription
ClassID Returns the type identifier corresponding to the actual class of the object.
Implements Determines whether the object implements the features of a given class.
Iterate Event raised to iterate over the elements of a container object.
Recipient Recipient of events sent by the object.
Serialize Event raised to serialize the object content into a stream.

System requirements

SystemMinimal versionRemarks
Palm OSPalm OS 3.0N/A