Oracle stored proc. from VB in ADO

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michel R.

    Oracle stored proc. from VB in ADO

    Hello,

    I'm trying to call an Oracle stored procedure from a VBA module in ADO
    through an ODBC connection. My procedure just inserts a record based on the
    2 parameters. Here's the code:

    Private Sub InsertNew()
    Dim objDB As ADODB.Connectio n
    Dim objcmd As ADODB.Command
    Dim RS As ADODB.Recordset
    Dim prm1 As ADODB.Parameter
    Dim prm2 As ADODB.Parameter

    Set objDB = New ADODB.Connectio n
    Set objcmd = New ADODB.Command
    Set RS = New ADODB.Recordset

    objDB.Open "Data Source=ODBC_GDA I; User Id=LUORA1A; Password=LUORA1 A;"
    objcmd.ActiveCo nnection = objDB
    objcmd.CommandT ype = adCmdStoredProc
    objcmd.CommandT ext = "Put_JSC" 'the name of my proc

    Set prm1 = objcmd.CreatePa rameter("p_code ", adVarChar, adParamInput, 20,
    "7")
    objcmd.Paramete rs.Append prm1
    Set prm2 = objcmd.CreatePa rameter("p_desc ", adVarChar, adParamInput, 32,
    "Bidon")
    objcmd.Paramete rs.Append prm2

    Set RS = objcmd.Execute

    Set RS = Nothing
    Set objcmd = Nothing
    Set prm1 = Nothing
    Set prm2 = Nothing
    Set objDB = Nothing
    End Sub

    This should work, according to what I saw all over the web, but it does not.
    I get this message: ODBC driver does not support the requested properties.

    I tried various other methods of calling a procedure with parameters but
    with no luck. I need help! Thank you all!

    Michel R.


Working...