DBStorage Object
Use this method to map Dictionary and SimpleList objects to and from the database, primarily for the storage of receipt and order information. The DBStorage object is created as needed on each page.
ProgID: | Commerce.DBStorage (Externally creatable) |
COM Class Name: | MSCSDBStorage_3_0 |
Type Library Name: | Commerce 1.0 Type Library |
DLL Name: | Commerce.dll |
Threading Model: | Both |
The single property of the DBStorage object is shown in the following table.
Property | Type | Description |
Mapping | Object | Maps a database column to an entry in the OrderForm or Dictionary object that DBStorage uses to insert and retrieve data.
This property is read/write. |
The methods of the DBStorage object are shown in the following table.
Method | Description |
CommitData | Updates one or more records in the database storage. |
DeleteData | Deletes a row from the database storage, based on the data stored in a Dictionary or OrderForm object. |
DeleteDataKey | Deletes a row of data from the database storage, based on the specified key. |
GetData | Retrieves a row of data from the database storage, based on a specified key value. |
InitStorage | Initializes the object. This method must be called prior to calling any other DBStorage method. |
InsertData | Inserts the specified data into the database storage. |
LookupData | Retrieves a single row from the database storage, based on the specified column names and values. |
LookupMultipleData | Retrieves multiple results from the database storage. |
ProcessData | Unpacks the data stored in the MarshalColumn column for a given row, and returns the resulting row in a Dictionary object. |
Remarks
The DBStorage object serves as an interface between the site database and Dictionary and OrderForm objects. A DBStorage object contains methods for transferring data between the database and the data object.
Using the CreateObject method of the Server object to instantiate a DBStorage object will return an uninitialized instance of the DBStorage object. Use the InitStorage method to initialize the returned object instance. Attempting to call any other DBStorage method prior to calling the InitStorage method results in an error.
When the DBStorage object retrieves data from the database, it creates the appropriate type of data object (an OrderForm or Dictionary object), stores the requested data there, and then returns the data object. When the DBStorage object is used to save data in the database, you pass it the OrderForm or Dictionary object containing the data, and the DBStorage method copies the data from the data object into the database.