I am not an extensive user of VB6.0. I am trying to build a simple application that would call an SP to be used to generate a report using Crystal Reports 6.0.
I don't know how to call the stored procedure. Could you please give me some hints.
Thanks!
ADOConnectionString = ""your db connection string here"
Dim adoConnection As ADODB.Connection
Dim adoRecordset As ADODB.Recordset
Set adoConnection = CreateObject("ADODB.Connection"
Set adoRecordset = CreateObject("ADODB.Recordset"
' Build a connection object.
With adoConnection
.ConnectionString = ADOConnectionString
.Open
'Now do Some work with the recordset
With adoRecordset
.Open "Your SP Name '" & InputVar & "'", adoConnection, adOpenStatic, adLockReadOnly
If adoRecordset.RecordCount >= 1 Then
'do something
else
'do nothing
end if
adoRecordSet.close
adoConnection.close
Set adoRecordset = nothing
Set adoConnection = Nothing
If your stored procedure does not return a recordset then you don't need to pipe it into one and can actually speed it up by useing the adExecuteNoRecords option.
On the way out you can look at the parameters collections values for anything that should have changed.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.