CodePudding user response:
This question is quite simpleBuild:
The CREATE PROC GG (@ id VARCHAR (80))
DECLARE @ CODE VARCHAR (80)
The SET @ CODE=@ id
Print @ CODE
Execution:
The exec GG 'aaa'
CodePudding user response:
Post code, see how you access,CodePudding user response:
Stick the parameters of the stored procedure definition and the calling code, is usually a parameter setting error,CodePudding user response:
Public cn As New ADODB. Connection 'definition connect
Public strCn As String 'define the connection character
STRCN="... "
Cn. Open strCn
Take parameters of the stored procedure call down
Dim para1 As New ADODB library. The Parameter input parameters'
Dim adoCmd As New ADODB.Com mand 'definition stored domestic
With adoCmd 'setting stored procedure
The ActiveConnection=cn
The CommandType=adCmdStoredProc
The CommandText="name" stored procedure name
End With
With para1 'setting the input parameters 1
.name="@ id entrepot storage" parameter Name, and the parameters of the stored procedure corresponding
. Type=ADODB. DataTypeEnum. AdInteger parameter Type
. Direction=ADODB. ParameterDirectionEnum. AdParamInput 'parameters input and output mode
End With
AdoCmd. The Parameters. Append para1 add variables to the stored procedure
Para1. Value=https://bbs.csdn.net/topics/id_ entrepot storage set the Value of the stored procedure
'AdoCmd. Execute 'Execute the stored procedure
After
Stickers to put,, ha ha
CodePudding user response:
The