|
|
 |
| Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

June 4th, 2004, 11:09 AM
|
|
Authorized User
|
|
Join Date: Jan 2004
Location: Frederick, MD, USA.
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Running oracle stored procedure from access
Does anyone know how to link to a stored procedure in Oracle from Acess and run it? I've seen it work with SQL Server but I'm having a tough time doing it with Oracle.
I think the syntax for sql server is just
execute procedure_name;
But I still haven't figured out how to link to a procedure using a query.
Any ideas/help would be great. Thanks!
|

June 4th, 2004, 11:23 AM
|
|
Authorized User
|
|
Join Date: Jul 2003
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Justine,
Try using "Pass through Query" in MS Access. That will allow you to execute stored procedures in Oracle.
Cheers,
Prat
|

June 4th, 2004, 11:51 AM
|
|
Authorized User
|
|
Join Date: Jan 2004
Location: Frederick, MD, USA.
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Well you're very helpful today! Thank you. I have my pass-through query all set up, but I'm getting an invalid sql statement error. I've tried both of the following statements. I can't get it to work in oracle either so I know it's wrong. I just don't know how to fix it.
EXECUTE sp_r2_refresh_project_issue;
Call sp_r2_refresh_project_issue;
Thanks again!
|

June 4th, 2004, 12:11 PM
|
|
Authorized User
|
|
Join Date: Jul 2003
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Justine,
In the Access database:
1. Select your pass through query
2. Click on the "Design" button to the right
3. Add the following in the SQL View:
begin
sp_r2_refresh_project_issue;
end;
4. Save it and execute the pass through query
Cheers,
Prat
|

June 4th, 2004, 01:08 PM
|
|
Authorized User
|
|
Join Date: Jan 2004
Location: Frederick, MD, USA.
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Works great, thank you so much!
|

December 21st, 2006, 08:07 AM
|
|
Registered User
|
|
Join Date: Dec 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
and what about stored procedure with parameter? how can i pass that paramenter to SP?
|

December 21st, 2006, 08:44 AM
|
|
Friend of Wrox
|
|
Join Date: Sep 2003
Location: Salisbury, Wiltshire, United Kingdom.
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Food for thought, there may be a better established method...
Build a pass-through query as above and add a piece of generic text which you use as your parameter... ie:
sp_r2_refresh_project_issue <<parameter1>>
Then using vba, change the querydef, on the fly, to edit the <<parameter1>>. Are you expecting an action or a result to be returned by your sp? If only an action, you could maybe think about a sub that will do this, for a result set... not entirely sure if there is an improvement to be made??
Let me know how you get on..
|

December 21st, 2006, 09:15 AM
|
|
Registered User
|
|
Join Date: Dec 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
i am expecting just an action. unfortunatelly, i cant touch oracle db. i was just given SP and i have to deal with it.
by the way how can i change <<paramater1>> on fly?
|

December 21st, 2006, 09:23 AM
|
|
Friend of Wrox
|
|
Join Date: Sep 2003
Location: Salisbury, Wiltshire, United Kingdom.
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Try something like:
=============================================
Public Function pfSendORACLE(strParameter As String) As Boolean
Dim qdf As QueryDef
Set qdf = CurrentDb.QueryDefs("qryYourQuery")
qdf.SQL = "Your ORACLE text " & strParameter 'depends how your query is built, but if like SQL they tend to go at the end!
qdf.Execute
pfSendORACLE = True
End Function
=============================================
You may want to put some error handling in to handle timeouts, missed connections etc... but so long as your original query is set up ok, then a change to a pass-through query like this should be no worries. The error handling would return false if the query did not execute... you would need to program this, otherwise change it to a sub and remove the pfSendORACLE = true line!
Hope it helps.
|

December 21st, 2006, 09:36 AM
|
|
Registered User
|
|
Join Date: Dec 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thanx a lot, i used your idea, and it seems to be working now. thanx a lot :-)
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |