This chapter describes the ActiveX interfaces, which are listed alphabetically by interface name. Within the entry for each interface, the methods and properties are listed alphabetically. For more information about the equivalent ObjectStore C++ API or behavior, as presented in the table in the next section, see the ObjectStore C++ API Reference.
OSAX Interfaces at a Glance
The following table provides a quick reference of equivalent interfaces.
The following sections describe the interfaces in more detail. They are presented in alphabetical order.
IOSAXCollection
Purpose
Represents an os_collection or a class derived from it. Methods
Add(element As Object)Inserts the element into the collection, using os_collection::insert.
Cardinality() As LongReturns the number of elements in the collection. This is the same as Count().
Count() As LongReturns the number of elements in the collection. This is the same as Cardinality().
ElementType()A settable property. You must set this to the element-appropriate type when you have a nonparameterized collection, such as an os_set. For example, if you have a collection of X* objects, and XClass is the class object for class X, and C is your collection, you need to say
C.ElementType = XClassbefore you can access elements from the collection.
Evaluate(query As String) As VariantReturns a collection of the same element type that is the result of the specified query.
IsEmpty() As BooleanReturns true if the collection is empty. Uses os_collection::empty().
IsOrdered() As BooleanReturns true for collections that are ordered lists.
Item() As ObjectReturns an element from the collection using os_collection::pick().
Remove(element As Object)Removes the element from the collection using
CloseCloses the database with os_database::close().
OpenOpens a database with os_database::open().
OpenMVCCOpens a database for MVCC; equivalent to os_database::open_mvcc().
Value(Name As String, type As IOSAXType) As ObjectReturns the value of the named root, which must have the specified type. Use a class object for the type. Class objects support the IOSAXType interface.
If the root has a typespec, the typespec is verified against the type. Otherwise, the type is assumed to be correct.
BeginInitialization() As BooleanReturns false if ObjectStore has already been initialized. This method can be called before any other ObjectStore methods that must be called before ObjectStore is initialized.
BeginTrans([ReadOnly As Variant])Starts a transaction using os_transaction::begin().
CommitTransCommits a transaction using os_transaction::commit().
CreateDatabase(Name As String,[CreateMode As Variant], [OverWrite As Variant],Creates a database.
[SchemaDatabase As Variant]) As IOSAXDatabase
The CreateMode is an octal UNIX-style file create mode that defaults to 0664. OverWrite is an optional Boolean that defaults to false. If true, an existing database by the same name is overwritten.
SchemaDatabase specifies a database to use for schema.
Equal(First As Object, Second As Object) As BooleanTells if two objects refer to the same C++ pointer.
Initialize([Reserved As Variant])Initialize ObjectStore. Should be set to 0.
InitializeTransactions()Does nothing on ObjectStore.
IsPersistent(Obj As Object) As BooleanReturns true if the object is stored in an ObjectStore database.
LanguageInterfaceMaintenanceRelease() As LongReturns the maintenance release of the language interface.
LanguageInterfaceMajorRelease() As LongReturns the major release of the language interface.
LanguageInterfaceMinorRelease() As LongReturns the minor release of the language interface.
LanguageInterfaceName() As LongReturns the name of the language interface.
LoadATKReference(Type As IOSAXType, RefString As Object) As ObjectReturns the object corresponding to the reference from ATK.
LookupDatabase(Name As String) As IOSAXDatabaseReturns an unopened IOSAXDatabase. Name is the name of a database.
MaintenanceRelease() As LongReturns the maintenance release number.
MajorRelease() As LongReturns the major release number.
MinorRelease() As LongReturns the minor release number.
OpenDatabase(Name As String, [ReadOnly As Variant], [CreateMode As Variant],Opens an existing database with the given Name.
[SchemaDatabase As Variant]) As IOSAXDatabase
ReadOnly is an optional Boolean defaulting to false.
CreateMode is a UNIX-style protection mode defaulting to 0. If it has a nonzero value and the database does not exist, the database is created with the specified protection.
SchemaDatabase is an optional IOSAXDatabase to be used for the schema.
OpenDatabaseMVCC(Name As String)Opens an existing database with the given Name for MVCC; equivalent to os_database::open_mvcc(Name).
ProductName() As StringReturns the name of the product.
RollbackRolls back a transaction using os_transaction::abort().
SetContext(Obj As Object)Changes the context associated with this ObjectStore Server to that of Obj.
StorageSystemName() As StringReturns the name of the storage system.
OSAX avoids this problem with IOSAXString, which is a reference to a char*. When Visual Basic asks for the value of an IOSAXString, a copy is made and returned at that time. If an IOSAXString object is passed to something that wants an IOSAXString argument, the original char* is available.
Value() As StringTranslates the char* value to a string using the ANSI code page.
ANSI(init As String, [where As Variant]) As IOSAXStringAllocates a char* and initializes it with init using the ANSI code page for translation. If where is specified, it should be the database in which to allocate the string.
Copy(Value As IOSAXString, [where As Variant]) As IOSAXStringMakes a copy of the string. If where is specified, it should be the database in which to allocate the string.
OEM(init As String, [where As Variant]) As IOSAXStringAllocates a char* and initializes it with init using the OEM code page for translation. If where is specified, it should be the database in which to allocate the string.
For example, the C++ class X has an IX interface for its instances and an IXClass interface for its class methods. The IXClass object also has an IOSAXType interface.
Cast(Obj As Object) As ObjectReturns an OSAX object for the same C++ pointer as its argument, only using the class as its instance type. You can use this to access root values that have no associated type.
Name() As StringReturns the class name associated with the type.
Updated: 03/18/98 13:58:00