LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default How do I retrieve the column names in a ADODB recordset from MS SQ

The following is a code chunk that I am using to retrieve a recordset from an
MS SQL Server using a function that I created on the server. The function
returns the records fine, but it doesn't return the column headers.

I would like to use the information to create/update a pivot table directly,
without having to paste the data to the spreadsheet via the copyfromrecordset
method.

Any ideas of what I'm missing.

Thanks in advance.

Mark

Set Cnxn = New ADODB.Connection
Cnxn.ConnectionTimeout = 0
Cnxn.Open strCnxn

'SQL to call from db
Set rs = New ADODB.Recordset
strSQL = "SELECT ClientID, Client, [Desc], Tool, Amount FROM
dbo.fnMyFunction('" _
& Format(DateValue(dtStart), "mm/dd/yyyy") & "','" _
& Format(DateValue(dtEnd), "mm/dd/yyyy") & "')"

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete ADODB Recordset Jim Thomlinson[_3_] Excel Programming 2 January 12th 05 04:16 AM
ADODB Recordset problem Stefen Percoco Excel Programming 2 July 26th 04 06:31 PM
0 with ADODB Recordset Stefen Percoco Excel Programming 1 July 8th 04 09:54 PM
adodb.recordset with excel nate axtell Excel Programming 14 June 11th 04 01:32 PM
ADODB Recordset Seth[_3_] Excel Programming 0 August 5th 03 02:15 PM


All times are GMT +1. The time now is 04:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"