currently converting a workbook from excel2003 to excel 2010.
in excel 2003, xlodbc was used to get data from oracle
i am using ADODB to get data from Oracle
in excel 2003 the following command was used to paste data in to the spread sheet
this single line of code pastes Column names in one row and data in the Row below.
when I use the command below it just puts the values
VBA help gives the below example but is there any other way instead of looping through
</PRE>
in excel 2003, xlodbc was used to get data from oracle
i am using ADODB to get data from Oracle
in excel 2003 the following command was used to paste data in to the spread sheet
Code:
SqlRetrieve Chan, Sheets("database").Range("fl_gas_fields_start"), 85, 2, True
this single line of code pastes Column names in one row and data in the Row below.
when I use the command below it just puts the values
Code:
Range("D6").CopyFromRecordset Rs1
VBA help gives the below example but is there any other way instead of looping through
Code:
For iCols = 0 to rs.Fields.Count - 1
ws.Cells(1, iCols + 1).Value = rs.Fields(iCols).Name
Next
ws.Range(ws.Cells(1, 1),
ws.Cells(1,rs.Fields.Count)).Font.Bold = True
ws.Range("A2").CopyFromRecordset rs
</PRE>
</PRE>