User Guide

478
OLE Automation Object Reference
VBScript Example (lines are numbered for clarity):
1. ' assume tblFeature is the Feature WTable
2. Dim row As WRow
3. For each row in tblFeature.WRows
4. ' set the description field to the feature name + "Description"
5. row("Description") = row("Feature") & " Description"
6. ' OR
7. ' row("Description") = row(0) & " Description"
8. Next
VBScript Example (lines are numbered for clarity):
1. Set tbl = WTables("Binary")
2. ' get side16 row
3. Set row = tbl.WRows.Row("side16")
4. ' write bitmap to c:\g.bmp
5. row.AccessBinaryData "Data",1,"C:\side16.bmp"
WRows
This is a collection of rows for a particular table.
Child of WRows
Properties Key(): key value for this row
Data(VARIANT vIndex): default property to get and set data for a column based on zero-
based index or column name
WColumns WColumns: get the collection of WColumns for this row
Methods AccessBinaryData(VARIANT vIndex,BinaryRead
Write bdWrite,BSTR filePath,BOOLEAN bLink):
vIndex - name of column or zero-based
bdWrite - 1 is write to file, 0 is read from file (there are enumerations bdWriteToFile and
bdReadFromFile
filePath - path to file to read/write data from/to
bLink - add an entry to scan this file at compile time to update the binary data if this file has
changed
Child of WTable
Methods WRow Row(BSTR strKeyValue): returns a WRow given its key value. For tables with
multiple key columns, commas separate key values. Row() is the default method.
void AddRow(WRow obRow): adds a row created by NewWRow to a table if it has not
already been added.
void Delete(WRow obRow,BOOL bSmartDelete): Deletes a given row from the row
collection. If bSmartDelete is TRUE, it also deletes associated rows in other tables.
Example: If you delete a component, a smart delete deletes all associated files, registry
keys, and so forth.
void DeleteKeyRow(BSTR bsKeyValue,BOOL bSmartDelete): Deletes a row given its
key value. In tables with multiple keys, commas separate key values. See above for an
explanation of bSmartDelete.