1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| Function Callproc_oracle(variable1 As Integer, variable2 As Integer, variable3 As Integer, variable4 As String, variable5 As String, variable6 As String, variable7 As String, variable8 As Double) As String
Dim cnn1 As ADODB.Connection
Dim cmdExeproc As ADODB.Command
Set cnn1 = New ADODB.Connection
strCnn = "DSN=xxxx; UID=yy_DBA; PWD=zz;"
cnn1.Open strCnn
Set cmdExeproc = New ADODB.Command
cmdExeproc.ActiveConnection = cnn1
cmdExeproc.CommandText = "{call entree_W9.entree(?,?,?,?,?,?,?,?)}"
cmdExeproc.Parameters(0).Direction = adParamInputOutput
cmdExeproc.Parameters(0).Value = variable1
cmdExeproc.Parameters(1).Direction = adParamInputOutput
cmdExeproc.Parameters(1).Value = variable2
cmdExeproc.Parameters(2).Direction = adParamInputOutput
cmdExeproc.Parameters(2).Value = variable3
cmdExeproc.Parameters(3).Direction = adParamInputOutput
cmdExeproc.Parameters(3).Value = variable4
cmdExeproc.Parameters(4).Direction = adParamInputOutput
cmdExeproc.Parameters(4).Value = variable5
cmdExeproc.Parameters(5).Direction = adParamInputOutput
cmdExeproc.Parameters(5).Value = variable6
cmdExeproc.Parameters(6).Direction = adParamInputOutput
cmdExeproc.Parameters(6).Value = variable7
cmdExeproc.Parameters(7).Direction = adParamInputOutput
cmdExeproc.Parameters(7).Value = variable8
cmdExeproc.Execute
end function |
Partager