Ado field collection 
Author Message
 Ado field collection
Hi

Simply want to load the field names on what is returned in the recordset in
a datagrid. The code below is wrong.  How would I move through the field
colloction and
input those names in a datagrid?

Dim i
Dim d

For i = 0 To Rs.Fields.Count - 1
  For d = 0 To DGridSearch.Columns.Count - 1
       DGridSearch.Columns(d).Caption = Rs.Fields(i).Name
  Next

Next

Thanks
Gerry



Tue, 12 Oct 2004 02:46:05 GMT
 Ado field collection

Dim i as Integer

 For i = 0 To Rs.Fields.Count - 1
    DGridSearch.Columns(i).Caption = Rs.Fields(i).Name
 Next i


Quote:
> Hi

> Simply want to load the field names on what is returned in the recordset
in
> a datagrid. The code below is wrong.  How would I move through the field
> colloction and
> input those names in a datagrid?

> Dim i
> Dim d

> For i = 0 To Rs.Fields.Count - 1
>   For d = 0 To DGridSearch.Columns.Count - 1
>        DGridSearch.Columns(d).Caption = Rs.Fields(i).Name
>   Next

> Next

> Thanks
> Gerry



Tue, 12 Oct 2004 06:56:25 GMT
 Ado field collection

Quote:
> Hi

> Simply want to load the field names on what is returned in the recordset
in
> a datagrid. The code below is wrong.  How would I move through the field
> colloction and
> input those names in a datagrid?

> Dim i
> Dim d

> For i = 0 To Rs.Fields.Count - 1
>   For d = 0 To DGridSearch.Columns.Count - 1
>        DGridSearch.Columns(d).Caption = Rs.Fields(i).Name
>   Next

> Next

Try BKY's sample code.

Quote:

> Thanks
> Gerry

Do you have more questions, Gerry?

Thanks,
Peter Wu
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure?  For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.



Tue, 12 Oct 2004 14:52:32 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Help with ADO Fields collection

2. recordset fields collection - ado

3. ADO and the Fields Collection

4. recordset fields collection - ado

5. Wanted - Sample DB2 + ADO Insert using fields collection

6. Querydef Object/Fields Collection in ADO?

7. Collection of ADO Recordsets and/or ADO Connections

8. Adding a field to the field collection?

9. collection into collection

10. collection into collection

11. ADO Errors collection doesn't store a SQLOLEDB error

12. ADO Errors Collection Problem


 
Powered by phpBB® Forum Software