Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is There a Way to Convert an Array to a Recordset?

Status
Not open for further replies.

tfayer

Technical User
Aug 4, 2002
41
US
If I use the Split Function on the string "one two thre", Is there a way to to create a RecordsetSet with the records:

one
two
three

Then If I wanted to refer to the record "one" how would I do that. I have tried.

Debug.Print rs.Item(1)

and it says Method or Data member not found.

Thanks
 
Hallo,

As far as I'm aware recordsets have to be based on tables or queries and the like, so the answer to your first question is no.

To create an array to hold strings, use:
Code:
private const cintMaxItems as integer = 10
dim strItem(1 to cintMaxItems) as string

'I'm not familiar with the split function, but you can refer
'to the elements using strItem(<index>), ie.
strItem(1) = &quot;one&quot;
strItem(2) = &quot;two&quot;
strItem(3) = &quot;three&quot;
dim i as integer
for i = 1 to 3
  debug.print strItem(i)
next i
Hope that helps,

- Frink
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top