I have the existing code that works great...
'Create a connection to sql server
Set con = CreateObject("ADODB.Connection")
Set recordSet = CreateObject("ADODB.Recordset")
con.Provider = "SqlOleDB"
con.Properties("Data Source").Value = "MySERVER"
con.Properties("Initial Catalog").Value = "MyDatabase"
con.Properties("Integrated Security").Value = "SSPI"
con.Open
'Prepare command string to get number of columns
sql = "Select * from ReportTable"
'Open connection
recordSet.Open sql, con
I need to change the code to fill the recordset from a stored procedure. When I change the sql code def to ...
'Prepare command string to get number of columns
sql = "exec spReportTable @MyID= 25"
It looks like it runs but tells me the recordset is closed any time I try to use it. Does anyone have any suggestions?
Thank You,
sabloomer
'Create a connection to sql server
Set con = CreateObject("ADODB.Connection")
Set recordSet = CreateObject("ADODB.Recordset")
con.Provider = "SqlOleDB"
con.Properties("Data Source").Value = "MySERVER"
con.Properties("Initial Catalog").Value = "MyDatabase"
con.Properties("Integrated Security").Value = "SSPI"
con.Open
'Prepare command string to get number of columns
sql = "Select * from ReportTable"
'Open connection
recordSet.Open sql, con
I need to change the code to fill the recordset from a stored procedure. When I change the sql code def to ...
'Prepare command string to get number of columns
sql = "exec spReportTable @MyID= 25"
It looks like it runs but tells me the recordset is closed any time I try to use it. Does anyone have any suggestions?
Thank You,
sabloomer