Odbc error data source name not found and no default driver specified

While connecting .NET to sybase server I got this error message: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified This has worked properly before. Syste...

While connecting .NET to sybase server I got this error message:

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

This has worked properly before. System DSN with same details worked and data connection through vs.net also worked.

I am using VS.NET 2005.

Any suggestions?

Andreas's user avatar

Andreas

5,2748 gold badges44 silver badges52 bronze badges

asked Nov 12, 2008 at 9:55

1

If you’re working with an x64 server, keep in mind that there are different ODBC settings for x86 and x64 applications. The «Data Sources (ODBC)» tool in the Administrative Tools list takes you to the x64 version. To view/edit the x86 ODBC settings, you’ll need to run that version of the tool manually:

%windir%SysWOW64odbcad32.exe (%windir% is usually C:Windows)

When your app runs as x64, it will use the x64 data sources, and when it runs as x86, it will use those data sources instead.

answered Feb 17, 2011 at 20:34

SqlRyan's user avatar

SqlRyanSqlRyan

32.8k33 gold badges113 silver badges195 bronze badges

3

For anyone coming to this latterly, I was having this problem over a Windows network, and offer an additional thing to check:

Python script connecting would work from commandline on my (linux) machine, but some users had problems connecting — that it worked from CLI suggested the DSN and credentials were right. The issue for us was that the group security policy required the ODBC credentials to be set on every machine. Once we added that (for some reason, the user had three of the four ODBC credentials they needed for our various systems), they were able to connect.

You can of course do that at group level, but as it was a simple omission on the part of one machine, I did it in Control Panel > ODBC Drivers > New

answered Nov 22, 2016 at 12:40

Withnail's user avatar

WithnailWithnail

3,0802 gold badges31 silver badges47 bronze badges

Perform the following steps:

  1. Start the Registry Editor by typing regedit in the Run window.
  2. Select the following key in the registry: HKEY_LOCAL_MACHINESOFTWAREODBC.
  3. In the Security menu, click Permissions.
  4. Grant Full Permission to the account which is being used for making connections.
  5. Quit the Registry Editor.

honk's user avatar

honk

8,77711 gold badges79 silver badges81 bronze badges

answered Nov 15, 2008 at 7:16

user37887's user avatar

Skip to main content

Support

Support

Sign in

Sign in with Microsoft

Sign in or create an account.

Hello,

Select a different account.

You have multiple accounts

Choose the account you want to sign in with.

Symptoms

«ODBC error. Data Source name not found and no default driver specified fatal error finish processing.»Reports run successfully on the local machine; the error occurs when they are sent to the Report Server queue.

Cause

The Data Source was not properly defined on the Report Server.

Resolution

Define the data source using the ODBC Administrator; the data source name must match the name specified in the Company Information.

References

Facebook

LinkedIn

Email

Need more help?

Expand your skills

EXPLORE TRAINING >

Get new features first

JOIN MICROSOFT 365 INSIDERS >

Was this information helpful?

(The more you tell us the more we can help.)

(The more you tell us the more we can help.)

What affected your experience?


Resolved my issue


Clear instructions


Easy to follow


No jargon


Pictures helped


Other


Didn’t match my screen


Incorrect instructions


Too technical


Not enough information


Not enough pictures


Other

Any additional feedback? (Optional)

Thank you for your feedback!

×

While connecting .NET to sybase server I got this error message:

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

This has worked properly before. System DSN with same details worked and data connection through vs.net also worked.

I am using VS.NET 2005.

Any suggestions?

Andreas's user avatar

Andreas

5,2748 gold badges44 silver badges52 bronze badges

asked Nov 12, 2008 at 9:55

1

If you’re working with an x64 server, keep in mind that there are different ODBC settings for x86 and x64 applications. The «Data Sources (ODBC)» tool in the Administrative Tools list takes you to the x64 version. To view/edit the x86 ODBC settings, you’ll need to run that version of the tool manually:

%windir%SysWOW64odbcad32.exe (%windir% is usually C:Windows)

When your app runs as x64, it will use the x64 data sources, and when it runs as x86, it will use those data sources instead.

answered Feb 17, 2011 at 20:34

SqlRyan's user avatar

SqlRyanSqlRyan

32.8k33 gold badges113 silver badges195 bronze badges

3

For anyone coming to this latterly, I was having this problem over a Windows network, and offer an additional thing to check:

Python script connecting would work from commandline on my (linux) machine, but some users had problems connecting — that it worked from CLI suggested the DSN and credentials were right. The issue for us was that the group security policy required the ODBC credentials to be set on every machine. Once we added that (for some reason, the user had three of the four ODBC credentials they needed for our various systems), they were able to connect.

You can of course do that at group level, but as it was a simple omission on the part of one machine, I did it in Control Panel > ODBC Drivers > New

answered Nov 22, 2016 at 12:40

Withnail's user avatar

WithnailWithnail

3,0802 gold badges31 silver badges47 bronze badges

Perform the following steps:

  1. Start the Registry Editor by typing regedit in the Run window.
  2. Select the following key in the registry: HKEY_LOCAL_MACHINESOFTWAREODBC.
  3. In the Security menu, click Permissions.
  4. Grant Full Permission to the account which is being used for making connections.
  5. Quit the Registry Editor.

honk's user avatar

honk

8,77711 gold badges79 silver badges81 bronze badges

answered Nov 15, 2008 at 7:16

user37887's user avatar


  • All forum topics


  • Previous Topic

  • Next Topic

jagrutijoshi

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

‎04-06-2017

04:36 AM

Hi,

I have created a Power BI Report using a MongoDB data source. I’ve used the following ODBC connector to connect MongoDB to Power BI http://www.cdata.com/drivers/mongodb/odbc/

When I publish my report online and try to schedule refresh using my personal gateway, the following error occurs in the data source credentials: ODBC: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

I’m sure that the data source name and driver are specified correctly. Could there be any another reason for this error? 


Message 1 of 13

116,935 Views

1 ACCEPTED SOLUTION

v-yuezhe-msft

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

‎04-17-2017

06:48 PM

Hi @jagrutijoshi,

You would also need to add all the CSV data sources under registered on-premises gateway, this way, you would be able to use on-premises gateway to refresh your dataset.

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


Message 10 of 13

166,711 Views


  • All forum topics


  • Previous Topic

  • Next Topic

12 REPLIES 12

ravikedia

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

‎09-26-2018

05:47 AM

Hi,

There is a ready connector available for Tally which can import all data from Tally at pre-defined interval. You may connect on contact@easyreports.in for further details.

Regards,

Ravi


Message 12 of 13

19,434 Views

ravikedia

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

‎09-26-2018

05:46 AM

Hi,

There is a ready connector available for Tally which can import all data from Tally at pre-defined interval. You may connect on contact@easyreports.in for further details.

Regards,

Ravi


Message 11 of 13

19,434 Views

v-yuezhe-msft

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

‎04-06-2017

07:20 PM

Hi @jagrutijoshi,

Do you install 32 bit or 64 bit ODBC connector ? And do you create system DSN for MongoDB following the guide in this blog?

Could you please install on-premises gateway and add the ODBC data source under the registered gateway, then check if you can set schedule refresh for your dataset?

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


Message 2 of 13

116,829 Views

v-yuezhe-msft

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

‎04-11-2017

12:42 AM

Hi @jagrutijoshi,

Have you added the ODBC data source under registered on-premises gateway?

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


Message 4 of 13

116,819 Views

v-yuezhe-msft

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

‎04-11-2017

01:50 AM

Hi @jagrutijoshi,

Could you please post a screenshot about your sceanrio? You can check this similar thread about how to add ODBC data source under gateway.

Thanks,

Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


Message 6 of 13

116,817 Views

v-yuezhe-msft

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

‎04-17-2017

02:35 AM

Hi @jagrutijoshi,

Have you included other data source except the ODBC data source in your dataset? Could you please post a screenshot about data sources in your PBIX file?  You can go to File -> Options and settings ->Data source settings to check data sources for Power BI Desktop.

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


Message 8 of 13

116,790 Views

v-yuezhe-msft

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

‎04-17-2017

06:48 PM

Hi @jagrutijoshi,

You would also need to add all the CSV data sources under registered on-premises gateway, this way, you would be able to use on-premises gateway to refresh your dataset.

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


Message 10 of 13

166,712 Views

  • Question

  • User944339287 posted

    hi guys, i have installed MySQL ODBC Driver 3.51 & 5.1 in my pc.

    I got the following error if my connection as below:

    Dim ConnStr As String = «DRIVER={MySQL ODBC 5.1 Driver};SERVER=localhost;DATABASE=db_testing;UID=user_testing;PASSWORD=12345;OPTION=3;»

    ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

    * but it’s working fine if i change ODBC 5.1 Driver to ODBC 3.51

    Please advice. TQ

All replies

  • User944339287 posted

    Hi, thanks for your replied.

    My connectionstring is correct, just cannot run with ODBC 5.1 Driver

    Please advice. TQ

  • User-1716253493 posted

    Maybe you need to configure DSN in Administration Tools => ODBC

    When install driver choose for all users instead current user

  • User1386501324 posted

    Hi, I had the same problem a few days ago.

    if you installed the apropiated driver:

    you must look on your server for the ODBC Data Source Administrator that can be found in Control Panel —> Administrative Tools —> Data Sources (ODBC). (on 64 bit Windows systems, you’ll have to explicitely call c:windowssyswow64odbcad32.exe
    ) and add the driver to the System DSN tab.

    bye

  • User-802364750 posted

    I had the same error message. The ODBC driver was not 64 bit. I had to compile my application as an x86 process and it worked. I just wanted to throw that out there for any else who encounters it.

  • User556814665 posted

    Thank you, thank you, and thank you.  Had an ancient 32 bit MS Access application that is a long way from being rewritten. Needed it run on Windows 7 64 bit. It just worked after folowing your directions. — Al    

  • User13166782 posted

    Yes it worked for me.

    I have just added the DNS.

    Thanks

  • User327387390 posted

    Hi, Patino:

    where did you have to call out «c:windowssyswow64odbcad32.exe» as you suggested?

    I am also in AMD 64 system and I have created ODBC in system DSN for both 32 bit and 64 bit.

    thanks in advance for your advice

This article, provides useful troubleshooting tips, for the following error which you might get, under certain circumstances, when trying to connect to SQL Server from Python, using pyodbc: [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect).

Prior to sharing our tips for troubleshooting the issue, let’s discuss about the two main ways of connecting to SQL Server from Python.

Ways of Connecting to SQL Server from Python

In Python, there are 2 main ways for connecting to SQL Server, using the pyodbc module and Microsoft ODBC Driver 17 for SQL Server.

Specifying the Full Connection String in Python

The first way, is to define the full connection string in you Python code.

For example, in case you are using a username/password instead of a trusted connection, here’s a relevant example:

conn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER=server_name;DATABASE=database_name;UID=user;PWD=password')

In case you are using a trusted connection, here’s another relevant example:

conn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER=server_name;DATABASE=database_name;Trusted_Connection=yes;')

Referencing an ODBC System DSN

The second way, is to reference an ODBC DSN.

Here’s a code example, that references and ODBC DSN:

conn = pyodbc.connect('DSN=mynewdsn;UID=user;PWD=password')

Learn more about SQL Server Data Access from Python – Enroll to our Course!

Enroll to our online course  “Working with Python on Windows and SQL Server Databases” with an exclusive discount, and get started with Python data access programming for SQL Server databases, fast and easy!

Working with Python on Windows and SQL Server Databases - Online Course

(Lifetime Access, Q&A, Certificate of Completion, downloadable resources and more!)

Enroll from $14.99


Troubleshooting the Issue

The error message we are examining in this post, indicates that we are trying to connect to SQL Server, using the second method, that is referencing an ODBC DSN and the process fails.

In this case, we can further troubleshoot the issue, by performing the below checks.

Check 1 – Verify that the DSN Name is Valid

Check in ODBC Data Source Administrator that the DSN exists with the exact same name you are referencing it in your Python code.

Additionally, you must check that the DSN indeed works.

For checking the DSN:

  • 64-bit ODBC Data Source Administrator if you are using a 64-bit version of Windows:
    C:WINDOWSSystem32odbcad32.exe
  • 32-bit ODBC Data Source Administrator if you are using a 32-bit version of Windows:
    C:WINDOWSSysWOW64odbcad32.exe

Check 2 – Verify that the DSN is Correctly Referenced in Python Code

If the DSN uses a username/password, you need to also specify it in your Python code as per below example:

conn = pyodbc.connect('DSN=dsn_name;UID=user;PWD=password')

If the DSN uses a trusted connection, you need to also specify it in your Python code as per below example:

conn = pyodbc.connect('DSN= dsn_name;Trusted_Connection=yes;')

If None of the Above Helps

If none of the above helps, then you may consider instead of using a DSN, to define the full connection in your Python code (see first way above).

Featured Online Courses:

  • Working with Python on Windows and SQL Server Databases
  • SQL Server 2022: What’s New – New and Enhanced Features
  • Introduction to Azure Database for MySQL
  • Boost SQL Server Database Performance with In-Memory OLTP
  • Introduction to Azure SQL Database for Beginners
  • Essential SQL Server Administration Tips
  • SQL Server Fundamentals – SQL Database for Beginners
  • Essential SQL Server Development Tips for SQL Developers
  • Introduction to Computer Programming for Beginners
  • .NET Programming for Beginners – Windows Forms with C#
  • SQL Server 2019: What’s New – New and Enhanced Features
  • Entity Framework: Getting Started – Complete Beginners Guide
  • Data Management for Beginners – Main Principles
  • A Guide on How to Start and Monetize a Successful Blog

Read Also:

  • Python Data Access Fundamentals
  • How to Connect to SQL Server Databases from a Python Program
  • What is Abstraction in Object Oriented Programming?
  • How to Run the SQL Server BULK INSERT Command from Within a Python Program
  • Useful Python Programming Tips
  • Main Data Structures in Python
  • IndentationError: expected an indented block in Python – How to Resolve it
  • Working with Python on Windows and SQL Server Databases (Course Preview)
  • How to Write to a Text File from a C++ Program
  • How to Establish a Simple Connection from a C# Program to SQL Server
  • The timeout period elapsed prior to obtaining a connection from the pool
  • Closing a C# Application (including hidden forms)
  • Changing the startup form in a C# project
  • Using the C# SqlParameter Object for Writing More Secure Code
  • Cannot implicitly convert type ‘string’ to ‘System.Windows.Forms.DataGridViewTextBoxColumn
  • Missing parentheses in call to ‘print’. did you mean print(…) – How to Resolve in Python

Check our online courses!

Check our eBooks!

Subscribe to our YouTube channel!

Subscribe to our newsletter and stay up to date!

Rate this article: 1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)

Loading…

Reference: SQLNetHub.com (https://www.sqlnethub.com)

© SQLNetHub

Artemakis Artemiou

Artemakis Artemiou is a Senior SQL Server Architect, Author, a 9 Times Microsoft Data Platform MVP (2009-2018). He has over 20 years of experience in the IT industry in various roles. Artemakis is the founder of SQLNetHub and {essentialDevTips.com}. Artemakis is the creator of the well-known software tools Snippets Generator and DBA Security Advisor. Also, he is the author of many eBooks on SQL Server. Artemakis currently serves as the President of the Cyprus .NET User Group (CDNUG) and the International .NET Association Country Leader for Cyprus (INETA). Moreover, Artemakis teaches on Udemy, you can check his courses here.

Views: 9,805

Problem

Attempts to connect to a data source either via IBM SPSS Modeler or the example program fail with the following error:

«Data Source name not found and no default driver specified»

Symptom

Unable to connect to data source

Cause

There is an error in the data source set up in the odbc.ini

Diagnosing The Problem

Review the data source name in the odbc.ini

Resolving The Problem

When defining a DSN in a UNIXLinux odbc.ini the datasource name specified in the [ODBC Data Sources] section must match exactly the datasource name specified within square brackets above the section in which you are defining the parameters for the DSN. If there is any mismatch between these you will see the error when attempting to make a connection to the datasource.
Eliminate any such mismatches from odbc.ini and ensure the example program can be used to successfully connect to the datasource.

[{«Product»:{«code»:»SS3RA7″,»label»:»IBM SPSS Modeler»},»Business Unit»:{«code»:»BU059″,»label»:»IBM Software w/o TPS»},»Component»:»Modeler»,»Platform»:[{«code»:»PF025″,»label»:»Platform Independent»}],»Version»:»Not Applicable»,»Edition»:»»,»Line of Business»:{«code»:»LOB10″,»label»:»Data and AI»}}]

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Odbc error backup exec
  • Odbc error 3146
  • Odbc error 08001
  • Ocx registration error
  • Ocx dll manager run time error 339

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии