Q: DAO 3.5 w/ODBCDirect call Oracle SP w/Output Params 
Author Message
 Q: DAO 3.5 w/ODBCDirect call Oracle SP w/Output Params

All,

I have an Oracle 7.3 stored procedure defined as follows:

create or replace procedure rk3(data_in IN NUMBER, data_out OUT NUMBER)
IS
BEGIN
     data_out := data_in * 2;
END;
/

I am using the 2.0 Oracle ODBC Driver which is Level 2 Compliant.

My VB Application is using DAO 3.0

I have cut most of the fat in my function, but here it is, in a nutshell:

Public Sub Test
    Dim qrySP As QueryDef
    Dim nResult As Integer
    Dim oConnection As Connection

    DBEngine.DefaultType = dbUseODBC

    Set oConnection = Workspaces(0).OpenConnection("", , False,
"ODBC;DSN=DATABASE;UID=USER;PWD=PASS;")
    End If

    Set qrySP = oConnection.CreateQueryDef("robk", "{call rk3(?, ?)}")

    qrySP.Parameters(0).Value = 10
    qrySP.Parameters(1).Direction = dbParamOutput
    qrySP.Execute
    nResult = qrySP.Parameters(1)

    qrySP.Close
End Sub

When the qrySP.Execute executes, I get error 3146 -- ODBC Call Failed.

I've tried Oracle's web site, Microsoft's Web Site and the Technet CD, as
well as the VB5 docs and some other books. I'm at wits end.

Any ideas?

Thanks in advance for any help.

Rob Konigsberg



Sat, 04 Mar 2000 03:00:00 GMT  
 Q: DAO 3.5 w/ODBCDirect call Oracle SP w/Output Params

Hi,

Simply build the string that would be entered
from within, say, WISQL, and use the Execute
method with that string as the parameter.  The
Execute should be on the Connection object ...
in your case "oConnection".  

Mark



Mon, 06 Mar 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. VB 4 and DAO 3.5/ODBCDirect

2. DAO 3.5 ODBCDirect and stored procs help

3. DAO 3.5 ODBCDirect and stored procs help

4. Database access with VB5, DAO 3.5 on Oracle 7.4 / NT4 / SP6

5. Moving from DAO 3.5 to DAO 3.6

6. DAO 3.5 & DAO 3.51 work differently

7. Convert DAO 3.5 to DAO 3.6 Jet Engine 4.0

8. DAO 3.5 vs DAO 3.51

9. DAO 3.5 object library vs. DAO 3.51

10. DAO 3.6 vs DAO 3.5 (VB6.0 sp3)

11. VB4 is DAO 3.5 safe, or DAO 3.0 better

12. VB4 is DAO 3.5 safe, or DAO 3.0 better

 

 
Powered by phpBB® Forum Software