Solved

Excel Connnection to SQL through ODBC

Posted on 2014-07-24
6
343 Views
Last Modified: 2014-07-25
Hello:

My new Windows 8 laptop will not let me attach files.  When I tried, it closed Internet Explorer.  Unfortunately, then, I will just have to explain the issue as best as I can.  

I created an Excel spreadsheet which pulls in data from SQL.  So, I have both an Excel spreadsheet and a .odc file.  

The customer wanted the SQL query revised.  So, I revised it.  When I run the query in SQL, it executes and displays data perfectly.

But, when I paste the query into the Excel spreadsheet, replacing the original query, I get the following error upon refreshing Excel:

The query did not run, or the database table could not be opened.  Check the database server or contact your database administrator.  Make sure the external database is available and hasn't been moved or reorganized, then try the operation again.

Any ideas?

Thanks!  Much appreciated!

TBSupport
0
Comment
Question by:TBSupport
  • 3
  • 2
6 Comments
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 40218502
> When I run the query in SQL, it executes and displays data perfectly.

What is "in SQL", exactly? SSMS? Excel Query Designer? something else?
0
 
LVL 1

Author Comment

by:TBSupport
ID: 40219319
SSMS
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 40219396
Try in query designer.

The easiest is probably to delete the query from excel, and then recreate it from scratch.

In my own queries, I make a trick to make excel independent from ODBC element After the workbook is ready, I open it with hex editor, find odbc description, and specify it there as DSN-less connecton (http://www.connectionstrings.com/microsoft-sql-server-odbc-driver/). After that, I can send the workbook to someone else and it will work.
0
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
LVL 10

Accepted Solution

by:
FamousMortimer earned 500 total points
ID: 40219432
I think by 'in SQL' he means Microsoft Query.

Can you try recreating the connection in the workbook and the ODBC connection?  Maybe that will point you to the problem.
0
 
LVL 1

Author Comment

by:TBSupport
ID: 40220064
I couldn't get it to work.  I'll just move on to something else, as usual.
0
 
LVL 1

Author Comment

by:TBSupport
ID: 40220067
So, this question can go to history, I'll give props to somebody.
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Video by: Zack
Viewers will learn the basics of using Excel Tables, the benefits found with them, and some pitfalls.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now