I am having a problem with stored procedures that return multiple recordsets
to VB. What I am trying to do, is to create a stored proc that returns 4
recordsets, and then loop through each of those recordsets and put them into
an excel spreadsheet. As you can see by my code example below, I am simply
saying set rs = 'run stored proc', when really I need to find a way to
reference which dataset I am going after with that particular recordset.
Any help would be great.
Thanks
/*-----------------------------------------------------
On Error GoTo Err_Handler
Dim goConn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim counter As Long
Dim strMessage As String
Dim totalCount As Long
Dim strConnString As String
Dim FileName As String
Dim FileLocation As String
Dim myExcelFile As New ExcelFile
Dim x
x = "sp_CRUD"
'initialize variables
FileLocation = "c:\"
FileName = "ExcelFile_" & Format(Now(), "mm_DD_YY_hh_mm_ss_AMPM") & ".xls"
strConnString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist
Security Info=False;Initial Catalog=IBM_Rpt;Data
Source=DAC_MKTSQL;Connection Timeout=50000"
counter = 0
Set goConn = New ADODB.Connection
Set rs = New ADODB.Recordset
'Open Excel App and create new worksheet and workbook
'Open Connection
goConn.ConnectionString = strConnString
goConn.CursorLocation = adUseServer
goConn.Open
'goConn.CommandTimeout = 50000
Dim SQLString As String
SQLString = Me.Text1 'Set rs = goConn.Execute(SQLString)
'rs.Source
'rs.ActiveConnecton = goConn
Set rs = goConn.Execute(SQLString)
/*-----------------------------------------------------
Zach Bowling
Sr. Manager of Customer Analytics
Work: 480.902.5908
Mobile: 602.391.5454
Email: [EMAIL PROTECTED]
http://www.direct-alliance.com
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists