Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
192
Добавлен:
11.05.2015
Размер:
4.96 Mб
Скачать

GetFieldType

Function GetFieldType(Field) As Integer

Use this method to obtain the type of data contained by a field in the Rowset. Data types are assigned to fields using AddField, Page 129.

Parameters

Field

This parameter indicates which field you are querying for the type of data contained. This field can accept either a numeric value or a string value. If you use a numeric value, it must be a number representing the field (column) of the Rowset you want to find out the data type of. Rowset columns, like array dimensions, are 0 based. The first column is 0, the second is 1, etc. If a string is used, the string must contain the name of the field.

Returns

A Visual Basic VarType constant indicating the type of data contained in the field.

Example

Dim dataType As Integer

dataType = cdoRowset.GetFieldType "Customer Id" If dataType = vbString Then

’ Do something with the string End If

MoveFirst

Function MoveFirst() As Boolean

This method moves to the first row (record) in the Rowset.

Returns

A Boolean value indicating whether or not the current row was successfully set to the first row. If the Rowset contains no data, this method will return False.

Example

cdoRowset.MoveFirst

Crystal Data Source Object Models

133

MoveNext

Function MoveNext() As Boolean

Moves to the next row (record) in the Rowset. The current record is set to the new row.

Returns

A Boolean value indicating whether or not the current record was successfully set to the next row in the Rowset. This function will return False if the current record before calling the method is the last row of the Rowset.

Example

cdoRowset.MoveNext

MoveTo

Function MoveTo(recordNum As Long) As Boolean

Moves the current record to the specified record number in the Rowset.

Parameters

recordNum

A 1-based value indicating to which record in the Rowset you want to move. The first record is 1, the second is 2, etc.

Returns

A Boolean value indicating whether or not the current record was successfully set to the specified record number. This method returns False is the specified record does not exist.

Example

cdoRowset.MoveTo 9

Reset

Sub Reset()

Resets the Rowset, clearing all fields and data.

Example

cdoRowset.Reset

Crystal Data Source Object Models

134

Соседние файлы в папке crystal