| | |
| ... | |
| Dim adocomm As New ADODB.Command | |
| Dim adopara As New ADODB.Parameter | |
| | |
| adocomm.ActiveConnection = MyCon | |
| adocomm.CommandType = adCmdStoredProc | |
| adocomm.CommandText = "sp_erase_personalid" | |
| | |
| ' Creating and appending the input parameter to the command object | |
| Set adopara = adocomm.CreateParameter("@Personal_id", adInteger, adParamInput) | |
| adopara.Value = "17" | |
| adocomm.Parameters.Append adopara | |
| | |
| ' Creating and appending the ouput parameter to the command object | |
| Set adopara = adocomm.CreateParameter("@output_id", adInteger, adParamOutput) | |
| adocomm.Parameters.Append adopara | |
| | |
| ' Executing the store procedure | |
| adocomm.Execute | |
| | |
| ' Retreiving values from the output parameters | |
| MsgBox adocomm.Parameters("@output_id").Value | |
| ... | |
| | |