Connect Excel to SQL developer without client installed

Dhiya

New Member
Joined
Jun 27, 2018
Messages
4
Hi All,

I have successfully connected excel to SQL developer using the below VBA code. I have oracle client and oracle dc drive in my machine.


Dim con As ADODB.connection
Dim rs As ADODB.Recordset
Dim Cmd As New ADODB.Command
Dim query As String
Dim strsql As String
Dim a As Integer
'Dim db As Dao.Database
Set con = New ADODB.connection
Set rs = New ADODB.Recordset
Application.ScreenUpdating = True
Cmd.CommandType = adCmdText
'--- Replace below highlighted names with the corresponding values
strCon = "Driver={Microsoft ODBC for Oracle}; " & _
"CONNECTSTRING=(DESCRIPTION=" & _
"(ADDRESS=(PROTOCOL=TCP)" & _
"(HOST=hostname)(PORT=portnum))" & _
"(CONNECT_DATA=(SERVICE_NAME=ser_name))); uid=username; pwd=password;"
'--- Open the above connection string.
con.Open (strCon)
***sql query*****
rs.Open strsql, con
Sheets(1).Range("A2").CopyFromRecordset rs

Now all I wanted to do is to connect DB without having client installed in my machine. Can any one pls guide me
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
That works well. But only with oracle client. When I run it in a machine where oracle client is not installed, I am getting error. I want it to run on the machines where client is not installed.
 
Upvote 0
You'll need to install an oracle driver on each machine. Most windows computers will not come with a driver for connecting to an oracle database.
 
Upvote 0
Oracle ODBC drivers version 8.1.7.4

am connecting to oracle sql developer. kindly let me know if that needs any other driver
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top