Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 369
  • Last Modified:

Excel Connnection to SQL through ODBC

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
TBSupport
Asked:
TBSupport
  • 3
  • 2
1 Solution
 
Vadim RappCommented:
> 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
 
TBSupportAuthor Commented:
SSMS
0
 
Vadim RappCommented:
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
Industry Leaders: 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!

 
FamousMortimerCommented:
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
 
TBSupportAuthor Commented:
I couldn't get it to work.  I'll just move on to something else, as usual.
0
 
TBSupportAuthor Commented:
So, this question can go to history, I'll give props to somebody.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now