Solved

Call to an Oracle stored procedure from Access 97

Posted on 1998-03-05
4
185 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
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

840 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