Solved

Call to an Oracle stored procedure from Access 97

Posted on 1998-03-05
4
187 Views
Last Modified: 2012-06-21
Is it possible to call (execute) an Oracle stored procedure from Access 97?

If so, could you please explain the whole process..

0
Comment
Question by:nesho
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
Carmy earned 150 total points
ID: 1970123
Use Pass-truogh Query (use ODBC).
Your Query should look like that:
"SELECT <myprocedure> FROM DUAL"
This will execute the function and return any value from your procedure.
0
 

Author Comment

by:nesho
ID: 1970124
Could you please give me an example code?
Thanks!
0
 
LVL 1

Expert Comment

by:Carmy
ID: 1970125
This function will return the ORACLE System Date (in-built stored procedure)
As I have no idea what your function is doing I used this example.  Replace 'SYSDATE' with your function.

For more indepth details - search Microsoft knowledge base, use keywords Pass-trough and Oracle.

Function GetOracleDate () as String
   
    Dim MyDB As Database
    Dim MyQuery As QueryDef
    Dim MySet as RecordSet
    Dim SourceConnectString As String
    Dim strSQL As String

    Set MyDB = CurrentDB()
    'Create a temporary query in memory only
    Set MyQuery = MyDB.CreateQueryDef ("")

    strSQL = "SELECT SYSDATE FROM DUAL"
    SourceConnectString = "ODBC;"
    MyQuery.Connect = SourceConnectString
    MyQuery.ReturnsRecords = True
    MyQuery.SQL = strSQL
    'Open the Recordset to return the Date
    Set MySet = MyQuery.OpenRecordSet()
    'Return the system date
    GetOracleDate = MySet!SYSDATE

End function

0
 

Author Comment

by:nesho
ID: 1970126
Have you ever got it working with your own function instead of built-in and how about using parameters with function?

Anything special I should do in case I want to pass a parameter to my function?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question