Link to home
Start Free TrialLog in
Avatar of jfz2004
jfz2004

asked on

EXCEL SQL Server Connection Question

Hi,

I want to start with a blank Excel. Then I want to connect to a SQL Server such that the connection property
will look at this (see attached image file). How to do that? How to get the settings as shown in the image file?

Thanks.

JenniferUser generated image
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Check out this EE article and scroll down about 40% of the way to view instructions with screen shots.
Avatar of jfz2004
jfz2004

ASKER

Thank you so much for the article. I learned somthign from it and tested it on a blank Excel.
But what I wanted to achieve are:
In the connection properties dialog box,
1. there is nothing in the "connection file";
2. the Proder = SQL Server, not SQLOLEDB.

How to get these two things? The options in Excel's "From Other Sources" confuses me greatly.

Jennifer
If you provide a connection string then you won't need to have a connection file. Connection file should be a .UDL file, I guess.
The provider is what you have installed for SQL Server connection. What do you have? MSSQL Native Client (SNAC)? .NET (ADO)? ODBC`? OLEDB?
Avatar of jfz2004

ASKER

Thanks. I have SQL Server and Excel.
Avatar of jfz2004

ASKER

Excel but no VBA code.
I mean drivers not applications. Which drivers do you have installed?
Avatar of jfz2004

ASKER

Drivers? How to check what drivers installed? I am new to this.
Thanks a lot.
Jennifer
If you check in you connection string the first word is DRIVER and you have SQL Server written on it. You can verify the installed drivers in Windows menu Start / Control Panel / Administrative Tools / Data Sources (ODBC) / Drivers tab.
You should see I list now. What you have listed for SQL Server?
Avatar of jfz2004

ASKER

In the "Connection Properties" dialogue box, there is a Connection string box. In it,
I have "Provider=SQLOLEDB.1;;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=..."

Is my driver SQLOLEDB, then?
Yes, in that case you are using SQLOLEDB.
Avatar of jfz2004

ASKER

And on the "Data" ribbon, there are 5 choices on the list of "From Other Sources". I don't know which one I should choose:
1. From SQL Server
2. ...
3. ...
4. From Data Connection Wizard
5. From Microsoft Query

Thanks for any help.
Avatar of jfz2004

ASKER

My query will pull data from a large table in a SQL Server DB and there is a where clause as "systemdate = ?" and the "?" refers to a cell. I don't know which of the above I should use. Thanks.
What are your knowledge in SQL Server area?
And also do you know well the table that you want to connect to?
Avatar of jfz2004

ASKER

I have a little bit of SQL Server knowledge, I know select and where clause.
If you know T-SQL then it's good. Chose the first option (1. From SQL Server).
The '?' means that the user will be asked to provide a value. It this case a date to be used in the WHERE clause.
Avatar of jfz2004

ASKER

I just tried your suggestion. Thanks.

But it asks for a connection fil and I don't want to use connection file.
I jsut want to use a Sql Query freely style.
Avatar of jfz2004

ASKER

I have been reading and seearching on the internet for a few days and seems like there is no sample for this kind of operation. I know this can be done, but non of the tutorials teaches it.
ASKER CERTIFIED SOLUTION
Avatar of Simon
Simon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jfz2004

ASKER

Thank you so much. I think this clears it. You rock!

Jennifer