Have come across 2 methods for opening a stored procedure as a recordset.
Is either of these (or indeed any other) better than the other:
METHOD 1:
Set rstRecords = New ADODB.Recordset
strSP = "up_parmsel_something (" & lngID & ")"
rstRecords.Open strSP, cnn1, adOpenStatic, adLockReadOnly, adCmdStoredProc
METHOD 2:
With rstRecords
.CursorType = adOpenStatic
.LockType = adLockReadOnly
End With 'rstRecords
With objCmd
Set .ActiveConnection = cnn1
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("ID", adInteger, adParamInput, , lngID)
.CommandText = "up_parmsel_something"
Set rstRecords = .Execute
End With 'objCmd
Appreciate any comments you may have.
Is either of these (or indeed any other) better than the other:
METHOD 1:
Set rstRecords = New ADODB.Recordset
strSP = "up_parmsel_something (" & lngID & ")"
rstRecords.Open strSP, cnn1, adOpenStatic, adLockReadOnly, adCmdStoredProc
METHOD 2:
With rstRecords
.CursorType = adOpenStatic
.LockType = adLockReadOnly
End With 'rstRecords
With objCmd
Set .ActiveConnection = cnn1
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("ID", adInteger, adParamInput, , lngID)
.CommandText = "up_parmsel_something"
Set rstRecords = .Execute
End With 'objCmd
Appreciate any comments you may have.