how to retrieve the record in a field with index? 
Author Message
 how to retrieve the record in a field with index?

In ADO recordset, I couldn't find a method such as rs.Fields(index, column
name)?

Please advice!
John



Sun, 27 Nov 2005 09:56:04 GMT  
 how to retrieve the record in a field with index?
Hmmm, not sure what you are trying to do. However, you do have

rs.index

-and-

rs.Fields(column).Value


Quote:
> In ADO recordset, I couldn't find a method such as rs.Fields(index, column
> name)?

> Please advice!
> John



Sun, 27 Nov 2005 11:38:15 GMT  
 how to retrieve the record in a field with index?
For example, how to retrieve the second field in the fifth row?


Quote:
> In ADO recordset, I couldn't find a method such as rs.Fields(index, column
> name)?

> Please advice!
> John



Sun, 27 Nov 2005 11:44:18 GMT  
 how to retrieve the record in a field with index?


Quote:
> For example, how to retrieve the second field in the fifth row?

rs.AbsolutePosition = 5
rs.Fields(1).Value

Quote:



> > In ADO recordset, I couldn't find a method such as rs.Fields(index,
column
> > name)?

> > Please advice!
> > John



Sun, 27 Nov 2005 19:34:30 GMT  
 how to retrieve the record in a field with index?
Hi,

Yes, it is one of the way to achieve that, but anyway it is not reliable
way. Since recordset may have different order of records inside of it,
depending on sorting, indexing and other conditions, you may have same
record in different position and that code will not work properly. I do not
see any reason to reference rows by index. You should use primary key unique
value to find specific record in a recordset. It is only 100% reliable way
to do that

--
Val Mazur
Microsoft MVP


Quote:



> > For example, how to retrieve the second field in the fifth row?

> rs.AbsolutePosition = 5
> rs.Fields(1).Value



> > > In ADO recordset, I couldn't find a method such as rs.Fields(index,
> column
> > > name)?

> > > Please advice!
> > > John



Sun, 27 Nov 2005 20:21:22 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. how to retrieve the record in a field with index?

2. remove index from field or delete a indexed field

3. Listview add index and retrieve index?

4. Retrieving newest records when fields are duplicated (2 nd Posting )

5. Help: retrieve LAST record on database of 50.000 record

6. Main record not retrieved if no sub record present

7. SQL To retrieve from record xxx to record yyy

8. Main record not retrieved if no sub record present

9. Adding Field to Access db - need to make indexed property of field No Duplicates

10. Numeric Index of RS.field from field name?

11. Retrieve Field Type of Recordset Field

12. Retrieve Field Type of Recordset Field

 

 
Powered by phpBB® Forum Software