Solved

Excel Connnection to SQL through ODBC

Posted on 2014-07-24
6
356 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
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.

707 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