
Please help me - execute Stored Procedures with component
Serge
Here is a sample code, modify of need be.
You need to use ADODB library.
Dim oRs As New ADODB.Recordset
Dim oCn As New ADODB.Connection
Dim oCm As New ADODB.Command
Dim oPrm As New ADODB.Parameter
With oPrm
.Direction = adParamInputOutput
.Size = 30
.Type = adChar
.Value = txtBox.Text
End With
With oCm
.ActiveConnection = oCn
.CommandType = adCmdStoredProc
.CommandText = "NameoftheStoredProcedure"
.CommandTimeout = 300
.Parameters.Append oPrm
End With
Set oRs =oCm.Execute
HTH
Sukesh
Quote:
> Hi!
> I've been struggling to execute a Stored Procedure that
> returns a Scalar Value from a Visual Basic component,
> I've been following the examples in the walkthroughs, the
> online help, MSDN, and a couple of books and it just
> doesn't run.
> In the attached file I've written down a short
> explanation of what I'm doing, please I'll appreciate
> whatever help anyone can give me.
> Thanks.