# MTInMemRowset

The in-memory rowset allows for the creation of a rowset programmatically. The in-memory rowset contains tabular data, that is, one or more columns and one or more rows. The user needs to initialize the rowset by defining the columns of the rowset. Once the columns have been defined, data can be added to the rowset via the AddFieldData method and additional rows may be added by the AddRow method.

## Program ID

MTInMemRowset.MTInMemRowset.1

## MTInMemRowset Methods

AddColumnData | The AddColumnData method adds the specified data to the specified column of the rowset.
AddColumnDefinition | The AddColumnDefinition method adds a column of the type specified to the definition of the rowset.
AddRow | The AddRow method adds a row to the rowset.
Init | The Init method initializes the in-memory rowset.
ModifyColumnData | The ModifyColumnData method modifies the specified column. It replaces the current value of the column with the new value.
MoveFirst | The MoveFirst method moves the cursor to the first row of the rowset.
MoveLast | The MoveLast method moves the cursor to the last row of the rowset.
MoveNext | The MoveNext method moves the cursor to the next row of the rowset.

## MTInMemRowset Properties

Count | The Count property gets the number of columns in the rowset.
EOF | The EOF property gets the status of the rowset cursor.
Name | The Name property gets the name of the specified column of the rowset.
RecordCount | The RecordCount property gets the number of rows in the rowset.
Type | The Type property gets the type of the specified column of the rowset.
Value | The Value property gets the value of the specified column of the rowset.

## Example

Example to be provided in a future release of this online help system.

# Method Detail

## AddColumnData

The AddColumnData method adds the specified data to the specified column of the rowset.

### Visual Basic Syntax

Sub AddColumnData(apName As String, aValue)

### C++ Syntax

HRESULT GetContents([out,retval] LPDISPATCH *pView);

### Arguments

apName

The name of the column.

aValue

The value of the data.

### Errors Raised

0xE1500004L - No rows are present in the rowset.

## AddColumnDefinition

The AddColumnDefinition method adds a column of the type specified to the definition of the rowset.

### Visual Basic Syntax

Sub AddColumnDefinition(apName As String, apType As String)

### C++ Syntax

HRESULT AddColumnDefinition([in] BSTR apName, [in] BSTR apType);

### Arguments

apName

The name of the column.

apType

The type of the column.

### Errors Raised

0xE1500004L - No rows are present in the rowset.

## AddRow

The AddRow method adds a row to the rowset.

### Visual Basic Syntax

Sub AddRow()

### C++ Syntax

HRESULT AddRow();

### Errors Raised

0xE1500004L - No rows are present in the rowset.

## Init

The Init method initializes the in-memory rowset.

### Visual Basic Syntax

Sub Init()

### C++ Syntax

HRESULT Init();

## ModifyColumnData

The ModifyColumnData method modifies the specified column. It replaces the current value of the column with the new value.

### Visual Basic Syntax

Sub ModifyColumnData(apName As String, aValue)

### C++ Syntax

HRESULT ModifyColumnData([in] BSTR apName, [in] VARIANT aValue);

### Arguments

apName

The name of the column to modify.

aValue

The value of the column data.

### Errors Raised

0xE1500004L - No rows are present in the rowset.

## MoveFirst

The MoveFirst method moves the cursor to the first row of the rowset.

### Visual Basic Syntax

Sub MoveFirst()

### C++ Syntax

HRESULT MoveFirst();

### Errors Raised

0xE1500004L - No rows are present in the rowset.

## MoveLast

The MoveLast method moves the cursor to the last row of the rowset.

### Visual Basic Syntax

Sub MoveLast()

### C++ Syntax

HRESULT MoveLast();

### Errors Raised

0xE1500004L - No rows are present in the rowset.

## MoveNext

The MoveNext method moves the cursor to the next row of the rowset.

### Visual Basic Syntax

Sub MoveNext()

### C++ Syntax

HRESULT MoveNext();

### Errors Raised

0xE1500004L - No rows are present in the rowset.

# Property Detail

## Count

The Count property gets the number of columns in the rowset.

This property is read-only.

### Visual Basic Syntax

Property Count As Long

### C++ Syntax

HRESULT Count([out, retval] long *pVal);

### Arguments

pVal

The number of columns in the rowset.

### Return Value

The number of columns in the rowset.

### Errors Raised

0xE1500004L - No rows are present in the rowset.

## EOF

The EOF property gets the status of the rowset cursor.

This is a read-only property.

### Visual Basic Syntax

Property EOF As Variant

### C++ Syntax

HRESULT EOF([out, retval] VARIANT *pVal);

### Arguments

pVal

The status of the rowset cursor.

### Return Value

The status of the rowset cursor.

### Errors Raised

0xE1500004L - No rows are present in the rowset.

## Name

The Name property gets the name of the specified column of the rowset.

This is a read-only property.

### Visual Basic Syntax

Property Name(vtIndex) As String

### C++ Syntax

HRESULT Name([in] VARIANT vtIndex, [out, retval] BSTR *pVal);

### Arguments

vtIndex

The specified column of the rowset.

pVal

The name of the column.

### Return Value

The name of the column.

### Errors Raised

0xE1500004L - No rows are present in the rowset.

## RecordCount

The RecordCount property gets the number of rows in the rowset.

This is a read-only property.

### Visual Basic Syntax

Property RecordCount As Long

### C++ Syntax

HRESULT RecordCount([out, retval] long *pVal);

### Arguments

pVal

The number of rows.

### Return Value

The number of rows.

### Errors Raised

0xE1500004L - No rows are present in the rowset.

## Type

The Type property gets the type of the specified column of the rowset.

This is a read-only property.

### Visual Basic Syntax

Property Type(vtIndex) As String

### C++ Syntax

HRESULT Type([in] VARIANT vtIndex, [out, retval] BSTR *pVal);

### Arguments

vtIndex

The specified column of the rowset.

pVal

The name of the column.

### Return Value

The name of the column.

### Errors Raised

0xE1500004L - Unable to get the type of a column in the rowset.

## Value

The Value property gets the value of the specified column of the rowset.

This is a read-only property.

### Visual Basic Syntax

Property Value(vtIndex) As String

### C++ Syntax

HRESULT Value([in] VARIANT vtIndex, [out, retval] VARIANT *pVal);

### Arguments

vtIndex

The specified column of the rowset.

pVal

The name of the column.

### Return Value

The name of the column.

### Errors Raised

0xE1500004L - No rows are present in the rowset.