Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public Function GetCompanyName(InCID As Long) As String
Dim cmd As ADODB.Command
Set cmd = New ADODB.Command
Dim prmInput As ADODB.Parameter
Dim prmOutput As ADODB.Parameter
' Set up a command object for the stored procedure.
With cmd
Set .ActiveConnection = Conn1 'Conn1 is previously defined & open
.CommandText = "get_company_name_from_id"
.CommandType = adCmdStoredProc
.CommandTimeout = 15
Set prmInput = .CreateParameter("@cid", adInteger, adParamInput, , InCID)
Set prmOutput = .CreateParameter("@cname", adVarWChar, adParamOutput, 255)
.Parameters.Append prmInput
.Parameters.Append prmOutput
.Execute
GetCompanyName = .Parameters(1).Value 'Zero-based array
End With
Set cmd = Nothing
End Function