Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning parameters from stored procedures with ODBCDirect
Message
General information
Forum:
Microsoft Office
Category:
Access
Title:
Returning parameters from stored procedures with ODBCDirect
Miscellaneous
Thread ID:
00450928
Message ID:
00450928
Views:
86
Has anyone worked with retrieving return values from Oracle stored procedures using ODBCDirect within Access 97? I'm running into some difficulty. Here's a partial code sample.

================================================================================
' The first 2 parms are return values. Other input parameters are passed,
' but not really relevant to this example.
strSQL = "{call InitializeSession(?,?, ...) }

' Create a query definition within the Oracle connection
Set qryInitializeSession = gcnnOracle.CreateQueryDef("qryInitializeSession", "")

' Specify parameters and execute the call
With qryInitializeSession
.Prepare = dbQUnprepare
.SQL = strSQL
.Parameters(0).Direction = dbParamReturnValue
.Parameters(1).Direction = dbParamReturnValue
...

' Now execute the call
.Execute

End With
================================================================================

The problem that I'm running into is this:
From everything I've read, after I create the QueryDef using ODBCDirect, ODBCDirect should create a Parameter object within the QueryDef's Parameters collection for each of the '?' placeholders in the call statement. However, that's not happening. When I try to set the Direction property of the first parameter, the code fails with the error "Object not found in collection."

I am admittedly new to using ODBCDirect so I'm not sure if the problem is that my ODBC driver does not support the capability or if I'm simply not understanding something. Does anyone have any idea what I'm doing wrong?

John
John Groft
Consultant
Computer Task Group, Inc.
Reply
Map
View

Click here to load this message in the networking platform