ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using Excel to call Oracle Stored procedure. (https://www.excelbanter.com/excel-programming/430857-using-excel-call-oracle-stored-procedure.html)

pdcjlw1

Using Excel to call Oracle Stored procedure.
 
I am trying to get Excel/MSQuery to call an Oracle stored procedure and
return a record set. Every time I try it I get an access violation error. Is
there a way to call an Oracle stored procedure (or function) and return a
record set to excel?
Thanks.
--
Thanks for the Memory.

Patrick Molloy

Using Excel to call Oracle Stored procedure.
 

in vba i use the following to read from SQL server
change the provider "MSDASQL" to whatever is appropriate for Oracle
also change servername, databasename ans stored_proc_name appropriately

Dim rst As ADODB.Recordset
Dim db As Connection
Dim SQL As String
Dim i As Long
Set db = New Connection

With db
.CursorLocation = adUseClient
.Open "PROVIDER=MSDASQL;driver={SQL
Server};server=SERVERNAME=;pwd=;database=DATABASEN AME;"
End With

Set rst = New Recordset
SQL = "STORED_PROC_NAME"
rst.Open SQL, db, adOpenStatic, adLockOptimistic

range("B5").CopyFromRecordset rst




"pdcjlw1" wrote in message
...
I am trying to get Excel/MSQuery to call an Oracle stored procedure and
return a record set. Every time I try it I get an access violation error.
Is
there a way to call an Oracle stored procedure (or function) and return a
record set to excel?
Thanks.
--
Thanks for the Memory.




All times are GMT +1. The time now is 12:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com