#  Other Applications & Softwares  > Access Tables & Databases >  >  Need to fetch results in a excel from SQL Developer with inputs from excel

## mani88

Hi I need to run a select query with inputs from excel. This query should be run in an external SQL developer and fetch results for the same and update the excel.

For example I have a query select Lname, fname from table where user id in 'mani' in cell A2, The results should be fetched in A4 with headers.


I am new to macros. Can anyone help me in connecting with the DB and help me fetch the results. I have no idea where I should give the connection name and password of the DB and connect it .

Kindly help me. I have attached a sample file

----------


## Kyle123

What's an "external SQL developer"?

----------


## mani88

it is just a SQL database. Generally we login to the data base using credintials and then we will run queries in it and fetch results

----------


## alansidman

Perhaps this?

http://office.microsoft.com/en-us/ex...010217956.aspx

or

http://stackoverflow.com/questions/1...e-in-excel-vba

----------


## mani88

Hi Alan I am new to VBA and I am not sure how to connect The SQL DB to the code in the link "http://stackoverflow.com/questions/1...e-in-excel-vba". What I have in my DB is 
Example:
HOST NAME: example.com
PORT : 1234
SID :SDYM01
User Name : Mani
Password: 1234

The DB I am using is SQL Developer 2.1.1. It would be great if you can see the attachment I want to run the query that is in the excel and the fetched result from the DB to be updated in sheet 2

Kindly help me out...

----------


## Kyle123

Why can't you use the first link? You don't need code to do this

----------


## mani88

I need a macro to do this, so that I can run the macro anyplace in any machine  :Smilie:  Kindly help  :Frown:

----------

