Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
When I dump the record onto a sheet, I hope to include the fields' name from the recordset. How can I do it? Shu Zi Yang -- thank you so much for your help |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can't.
Loop through the fields and stick the names above the recordset. Dim nFieldIndex as Long For nFieldIndex = 0 to rs.Fields.Count - 1 Cells(1, 1+nFieldIndex).Value = rs.Fields(nFieldIndex ).Name Next -- Tim Zych SF, CA "clara" wrote in message ... Hi all, When I dump the record onto a sheet, I hope to include the fields' name from the recordset. How can I do it? Shu Zi Yang -- thank you so much for your help |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Tim,
If I want to chage some fields from number to descriptive string, how can I do it when I use CopyFromRecordset. For example, in filed Serverity 1 means "Low"; 2 means "Medium" Clara -- thank you so much for your help "Tim Zych" wrote: Can't. Loop through the fields and stick the names above the recordset. Dim nFieldIndex as Long For nFieldIndex = 0 to rs.Fields.Count - 1 Cells(1, 1+nFieldIndex).Value = rs.Fields(nFieldIndex ).Name Next -- Tim Zych SF, CA "clara" wrote in message ... Hi all, When I dump the record onto a sheet, I hope to include the fields' name from the recordset. How can I do it? Shu Zi Yang -- thank you so much for your help |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The query/stored proc should do it, IMO. I suppose you could perform a
find/replace to the results but my preference is to keep the logic in 1 place. -- Tim Zych SF, CA "clara" wrote in message ... Hi Tim, If I want to chage some fields from number to descriptive string, how can I do it when I use CopyFromRecordset. For example, in filed Serverity 1 means "Low"; 2 means "Medium" Clara -- thank you so much for your help "Tim Zych" wrote: Can't. Loop through the fields and stick the names above the recordset. Dim nFieldIndex as Long For nFieldIndex = 0 to rs.Fields.Count - 1 Cells(1, 1+nFieldIndex).Value = rs.Fields(nFieldIndex ).Name Next -- Tim Zych SF, CA "clara" wrote in message ... Hi all, When I dump the record onto a sheet, I hope to include the fields' name from the recordset. How can I do it? Shu Zi Yang -- thank you so much for your help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Include a Picture Field | New Users to Excel | |||
ADO Recordset include Field names | Excel Programming | |||
Code to include a one-up suffix to a field value | Excel Discussion (Misc queries) | |||
Limit to field size with .CopyFromRecordset | Excel Programming | |||
Excel 2003 SP1: CopyFromRecordset error if field above 911 charact | Excel Programming |