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

venkatesh padmanabhan 181 Reputation points
2022-06-16T10:07:58.903+00:00

Hi.
I am trying to connect to AS 400 connection string from my visual studio code.

Dim ConnString As String
Dim As400Conn As Object
ConnString = "DSN=" + "DSN value" + ";" + "UID=" + "UID" + ";" + "PWD=" + "PWD" + ";"
As400Conn = CreateObject("ADODB.Connection")
As400Conn.Open(ConnString)

I am getting error as : [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

SOURCE : Microsoft OLE DB Provider for ODBC Drivers

How to fix this ? Thanks

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,755 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Jiachen Li-MSFT 32,851 Reputation points Microsoft Vendor
    2022-06-17T02:15:05.37+00:00

    Hi @venkatesh padmanabhan ,
    Please check if the solution in the link below worked for you.
    https://stackoverflow.com/questions/17115632/microsoftodbc-driver-manager-data-source-name-not-found-and-no-default-drive
    Best Regards.
    Jiachen Li

    ----------

    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Turlapati, Sai kamal chand 0 Reputation points
    2023-07-04T14:39:52.55+00:00

    Hi All,

    I am using

    engine=create_engine('mssql+pyodbc://' + server + '/' + database +'?driver=ODBC+Driver+17+for+SQL+Server?Trusted_Connection=yes?executemany=True',fast_executemany =True)

    And, when I try to convert dataframe to sql, I get error

    df.to_sql(table, con=engine , if_exists='append' , chunksize = chunk, index=False)

    The error is

    InterfaceError: (pyodbc.InterfaceError) ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')

    Can someone please help with what I am missing here?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.