Public Function GetNextOrdNo(cnn As ADODB.Connection) As String
Dim rst As ADODB.Recordset
Dim vResult As Variant
Dim oCmd As New ADODB.Command
GetNextOrdNo = "00000000"
With oCmd
Set .ActiveConnection = cnn
.CommandType = adCmdStoredProc
.CommandText = "GetNextOrderValue" ' name of stored procedure
' get parameter set from SP
.Parameters.Refresh
' set value of first parameter
'.Parameters("@InputData").Value = "10-37-3394"
.Execute
' get result from output parameter
vResult = .Parameters("@NextOrderValue").Value
End With
GetNextOrdNo = vResult
End Function
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.