Solved

Excel Connnection to SQL through ODBC

Posted on 2014-07-24
6
340 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

758 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

20 Experts available now in Live!

Get 1:1 Help Now