Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.databases.oracle    |    Overblown overpriced overengineered SHIT    |    2,288 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 422 of 2,288    |
|    Michel R. to All    |
|    Oracle stored proc. from VB in ADO    |
|    18 Sep 03 10:07:49    |
   
   From: michelr@hydro.qc.ca   
      
   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.Connection   
   Dim objcmd As ADODB.Command   
   Dim RS As ADODB.Recordset   
   Dim prm1 As ADODB.Parameter   
   Dim prm2 As ADODB.Parameter   
      
    Set objDB = New ADODB.Connection   
    Set objcmd = New ADODB.Command   
    Set RS = New ADODB.Recordset   
      
    objDB.Open "Data Source=ODBC_GDAI; User Id=LUORA1A; Password=LUORA1A;"   
    objcmd.ActiveConnection = objDB   
    objcmd.CommandType = adCmdStoredProc   
    objcmd.CommandText = "Put_JSC" 'the name of my proc   
      
    Set prm1 = objcmd.CreateParameter("p_code", adVarChar, adParamInput, 20,   
   "7")   
    objcmd.Parameters.Append prm1   
    Set prm2 = objcmd.CreateParameter("p_desc", adVarChar, adParamInput, 32,   
   "Bidon")   
    objcmd.Parameters.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.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca