|
-
Jun 3rd, 2002, 12:20 AM
#1
Thread Starter
Hyperactive Member
recordsets question
hello,
in ADO, can u use on recordset as a basis for a select statement on another one.
for example, if you have rstNames with a bunch of names, could u create a rstA and use rstNames to obtain all the names starting with A from rstNames?
Thanks for your time
Ang
-
Jun 3rd, 2002, 02:11 AM
#2
Junior Member
You don't have to create another recordset just to obtain a resultset that has a name starting from 'A'. All you have to do is to pass a query the filters your previous recordset --'rstNames'-- to display all names starting from 'A'.
Try this code:
rstNames.Open "Select * from [table name] where name like 'A%',cn,adLockReadOnly,adCmdText
-
Jun 3rd, 2002, 03:20 AM
#3
Thread Starter
Hyperactive Member
ok ta
-
Jun 3rd, 2002, 06:30 AM
#4
You could also filter your recordset.
VB Code:
rstNames.Filter = "name like 'A%'"
After the use of it you can reset the filter by
rstNames.Filter = ""
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|