Share via

DataFormat.Error: ODBC--connection to 'SQL DB name' failed. from excel to accdb to SQL

Anonymous
2019-07-25T22:29:01+00:00

OK, I have an accdb that has links to an SQL database. No problem there. Connections are good.

What I want to do is Connect to the access db through excel> Data>get Data >from MS Access database

It will connect, but when I try to  select a query that has data from a linked SQL table I get the message above "DataFormat.Error: ODBC--connection to 'SQL DB name' failed"

Isthere a way to connect to the SQL through excel via access? or a workaround?

I used to be able to do this through OLE DB connections with the old .mdb format

The new excel is playing havoc with my old queries. Upgraded from 2007 on my new desktop a few months ago.

Redoing a lot of queries now.

Info:

Windows 10 pro

Office 365 business (professional)

Excel vers 1906

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2019-07-29T15:38:21+00:00

    Maybe I have the "unholy Mix" I am trying to access a query in Access that pulls data from Access tables and from SQL tables through Excel.

    How do you tell if it is "live"?. I am assuming it is. SQL is linked with DSN in Access

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2019-07-27T12:07:50+00:00

    It works for me.  How are you linking your SQL tables?  DSN?  DSN-less?  Are you doing any linking jiggery-pokery on the Access application's start-up?  I only ask because my linked-table accdb's all build their links to their "live" database only when the application is launched.  If I tried to import to Excel from the linked tables, it would fail because the tables weren't linked to their "live" database.

    Not sure why you want to do this anyway.  Why not go directly to the SQL Server database rather than through Access?  If you have queries in the Access database you want to use, it's generally pretty easy to copy the SQL from an Access query and fix it up to work as a native SQL Server query/view (unless, of course, you have some unholy mix of linked and local tables).

    Was this answer helpful?

    0 comments No comments