Read a table into an array

  • Thread starter Thread starter JattilaB
  • Start date Start date
J

JattilaB

how can I read a tabel to an arry?
I would like to achive this wiht in a vb code inside the database...?
 
Please do not multi-post into more than one group.




how can I read a tabel to an arry?
I would like to achive this wiht in a vb code inside the database...?
 
If you're using ADO, you can create a recordset on your query and then use
the GetRows

--
Malcolm E. Cook
Stowers Institute for Medical Research

GetRows Method
Retrieves multiple records of a Recordset object into an array.

Syntax
array = recordset.GetRows( Rows, Start, Fields )Return Value
Returns a Variant whose value is a two-dimensional array.

Parameters
Rows
Optional. A GetRowsOptionEnum value that indicates the number of records
to retrieve. The default is adGetRowsRest.
Start
Optional. A String value or Variant that evaluates to the bookmark for the
record from which the GetRows operation should begin. You can also use a
BookmarkEnum value.
Fields
Optional. A Variant that represents a single field name or ordinal
position, or an array of field names or ordinal position numbers. ADO
returns only the data in these fields.
Remarks
Use the GetRows method to copy records from a Recordset into a
two-dimensional array. The first subscript identifies the field and the
second identifies the record number. The array variable is automatically
dimensioned to the correct size when the GetRows method returns the data.

If you do not specify a value for the Rows argument, the GetRows method
automatically retrieves all the records in the Recordset object. If you
request more records than are available, GetRows returns only the number of
available records.

If the Recordset object supports bookmarks, you can specify at which record
the GetRows method should begin retrieving data by passing the value of that
record's Bookmark property in the Start argument.

If you want to restrict the fields that the GetRows call returns, you can
pass either a single field name/number or an array of field names/numbers in
the Fields argument.

After you call GetRows, the next unread record becomes the current record,
or the EOF property is set to True if there are no more records.
 
Ok I found that and I have it working to some part but...

hoe can I tell it read a different table then the one I am currently working
with in my existing form?

I have the array the way I want it... but now I would like to refrence it to
another table besides the default one


make sense?
 
Back
Top