| || |
Getting the Field Name in a recordset
Can anyone help me to retrieve the name of the fields in a recordset.
And also how to write the return recordset into an excel sheet.
Please help me.
Re: Getting the Field Name in a recordset
I tried with following code and it worked. If anyone has anyother simple code. Please let me know.
Open "c:\Reports.csv" For Output As #FileNum
For Each Fields In dbrec.Fields
Write #FileNum, Fields.Name;
While dbrec.EOF <> True
Write #FileNum, '\n';
For i = 0 To (dbrec.Fields.Count - 1)
Write #FileNum, dbrec.Fields(i);