Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
My Excel program is a front end to a SQL backend.
Users run various reports that execute stored procedures in SQL server. My question is I use the "copyfromrecordset" code to autofill the returning recordsets into a worksheet however they dont return the column headers. How do I get the column headers either from VBA Excel or from the SQL stored procedures. The stored procedures are just simple "Select * from" statements. here is the code that works but has no headers. myConnection.Open Set myCommand.ActiveConnection = myConnection Set myRecordSet.ActiveConnection = myConnection myCommand.CommandText = strSQL myCommand.CommandType = adCmdText myCommand.Execute myRecordSet.Open myCommand 'Paste to spreadsheet ThisWorkbook.Worksheets("Report").Range("a2").Copy FromRecordset myRecordSet thanks for any help |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
CopyfromRecordset | Excel Programming | |||
CopyFromRecordset | Excel Programming | |||
CopyFromRecordset does nothing | Excel Programming | |||
CopyFromRecordset does nothing | Excel Programming | |||
Copyfromrecordset Bug ? | Excel Programming |