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

    Question

  • Hi All,

    When i tried to connect Oracle database(8i) .I am getting an error "ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified".

    My Connection string is :

    "Provider=msdaora;DSN=U500.WORLD;Uid=xyz;Pwd=123;"

    Please help me out to clear this task.

    Thanks in Advance

     

    Wednesday, February 07, 2007 4:31 PM

Answers

All replies

  •  

    Have a look at following

    http://www.connectionstrings.com/

    Should help you.

    As you are trying to connect to Oracle Database, you might need to have Oracle Client installed.

     

     

    • Marked as answer by Senthil.P Friday, March 15, 2013 7:18 PM
    Wednesday, February 07, 2007 5:00 PM
  • Make sure you have required driver installed and provide that driver and server name in connection string too like:

    DRIVER={XXXX Driver V XXXX};Provider=msdaora;DSN=U500.WORLD;Uid=xyz;Pwd=123;SERVER=localhost;"

    Best Regards,

    Rizwan aka RizwanSharp

    Wednesday, February 07, 2007 5:03 PM
  • Thanks.I have a oracle 8i clent installed .I have a Oracle server in another system and i created a DSN for that i an using DSN to connect that. I don't know waht is the driver for Oracle 8i. Can you please help me out ?..

     

    Thanks

    Wednesday, February 07, 2007 5:18 PM
  •  

    try this

    Driver={Microsoft ODBC for Oracle}

    Wednesday, February 07, 2007 5:25 PM
  • Try frist from this page:

    http://www.connectionstrings.com/?carrier=oracle

    Best Regards,

    Rizwan aka RizwanSharp

    Wednesday, February 07, 2007 5:28 PM
  • thanks . I tried the connection strings web site .That doesnt help me alot.

     

     

    Wednesday, February 07, 2007 5:34 PM
  • Same Error again ?
    Wednesday, February 07, 2007 5:35 PM
  • Thanks.I tried using driver,.I got the following error "{"ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed\r\nERROR [01000] [Microsoft][ODBC Driver Manager] The driver doesn't support the version of ODBC behavior that the application requested (see SQLSetEnvAttr).\r\nERROR [01S00] [Microsoft][ODBC driver for Oracle]Invalid connection string attribute" }"

    Help me out

    Wednesday, February 07, 2007 5:36 PM
  • System.Data.OracleClient namespace is the .NET Framework Data Provider for Oracle. I hope you are using that.

    Wednesday, February 07, 2007 5:43 PM
  • Hi ... I am using vs 2003 till !!!!!!!!!!!
    Wednesday, February 07, 2007 5:45 PM
  • No .. Different Error ...

     Thanks.I tried using driver,.I got the following error "{"ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed\r\nERROR [01000] [Microsoft][ODBC Driver Manager] The driver doesn't support the version of ODBC behavior that the application requested (see SQLSetEnvAttr).\r\nERROR [01S00] [Microsoft][ODBC driver for Oracle]Invalid connection string attribute" }"

    Help me out

    Wednesday, February 07, 2007 5:48 PM
  •  

    I think it should be there in .NET 1.1 (2003)

     

    http://msdn2.microsoft.com/en-us/library/system.data.oracleclient(VS.71).aspx

     

    • Proposed as answer by Fahad7 Tuesday, April 24, 2012 7:19 AM
    Wednesday, February 07, 2007 5:50 PM
  • This may help you too like that guy,

    use System.Data.OracleClient namespace. For this you need to add reference to System.Data.OracleClien.

    Best of Luck.

    Best Regards,

    Rizwan aka RizwanSharp

    Wednesday, February 07, 2007 5:50 PM
  • Its actually really simple dude.

    Administrative Tools --> Data Sources (ODBC) --> Create a connection

    In Visual Studio --> Open your server browser and then create a new connection. Select the connection type as Microsoft ODBC Data Source (ODBC).

    Select the radio button for Using Connection String, Select Machine Data Source and the select your data source you just created.

    You can just copy this string and paste it in to your web/app.config file.

    Easy as pie... 
    • Proposed as answer by Pablo Espinar Thursday, September 27, 2012 3:28 PM
    Friday, February 19, 2010 11:00 AM
  • Just throwing it in there, but do you happen to be using a x64 variant of Windows?

    If so, i'd suggest you have your application build for the x86 platform, and not "Any CPU".

    Another option could be to install x64 drivers for Oracle (if they exist).

    To change the platform target, go to your project properties, click the "Build" tab and change target platform to "x86" instead of "Any CPU"

    My developer blog
    Friday, February 19, 2010 11:14 AM
  • Brilliant and elegant!  Thank you, Kevin.

    -PS 

    Thursday, July 15, 2010 5:35 PM
  • I created a DSN - Oracle in OraHome92 - and it solved the issue.
    Thursday, November 04, 2010 7:30 PM
  • Where we can get the Oracle 10gi driver for DSN
    Tuesday, December 21, 2010 9:23 AM

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

    I have been receiving the same error when I try to access my csv file (at specific location)

    through ODBC connection "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=C:abc\xyz\";Extensions=asc,csv,tab,txt")"

    of asp.net application which was deployed on IIS 7.5. I have provided full rights (everyone) on the folder.

     

    Saturday, May 07, 2011 2:12 AM
  • Have you installed Oracle Client in your PC?

    http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html

    Download one from here. If I am right there are backward compatible.

    chanmm


    chanmm
    Saturday, May 07, 2011 4:01 AM
  • Hello All,

    I am trying to estalish a connection and import the CSV files from a network share to a dataset. Here is the code I am using.

    app.config file:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <appSettings >
        <add key="ImportLocation" value="\\networkshare\xyzfoldername"/>
     
      </appSettings>
     
    </configuration>

     private static void Import()
            {
                string filepath = GetFile();
                DataSet ds = Utility.ConnectCSV("", filepath);
             
            }

     private static string GetFile()
            {
                string filepath = ConfigurationManager.AppSettings["ImportLocation"].ToString();

                string filename = "\\CapitalSpend." + DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString("00") + DateTime.Now.Day.ToString("00") + ".csv";

                string fullpath = filepath + filename;
                return fullpath;
            }

     public static DataSet ConnectCSV (string filetable, string filepath)
            {
              DataSet ds = new DataSet ();
              System.Data.Odbc.OdbcDataAdapter obj_oledb_da;
              try
               {        
                   /* You can get connected to driver either by using
                   DSN or connection string. Create a connection string
                   as below, if you want to use DSN less connection.
                   The DBQ attribute sets the path of directory which
                   contains CSV files*/

                   string strConnString =
                         "Driver={Microsoft Text Driver (*.txt;*.csv)}; Dbq=" + filepath.Trim() + ";Extensions=asc,csv,tab,txt;Persist Security Info=False";

                   string sql_select;                                
                   System.Data.Odbc.OdbcConnection conn;        
            
                   //Create connection to CSV file

                  // conn = new System.Data.Odbc.OdbcConnection(strConnString.Trim ());

                   conn = new System.Data.Odbc.OdbcConnection();

                   // For creating a connection using DSN, use following line

                   //conn = new System.Data.Odbc.OdbcConnection(DSN="MyDSN");

        
                   //Open the connection

                   conn.Open ();
                   //Fetch records from CSV

                   sql_select="select * from ["+ filetable +"]";
                    
                   obj_oledb_da=new System.Data.Odbc.OdbcDataAdapter(sql_select,conn);
                   //Fill dataset with the records from CSV file
                   obj_oledb_da.Fill(ds,"Actuals");
                  
                   //Close Connection to CSV file
                   conn.Close ();                
               }
               catch (Exception e) //Error
               {
                   throw e;
               }
               return ds;
    }

    When I run this code, It throws out an exception when trying to open the connection as "
    ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified".

    Please anyone let me know the cause for this and how this can be rectified.

    Thank you

    Smith


    smith
    • Merged by Aspen VJ Monday, June 27, 2011 4:47 AM duplicated
    Wednesday, June 22, 2011 6:05 PM
  • Hi Smith,

    Please don't post duplicated threads.

    http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/4ac99b36-c512-45d2-8b30-8a70ce8e5b3e/

    I will merge them.


    Vin Jin [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, June 27, 2011 4:46 AM
  • This error:  

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

    was also encountered when .net application is built with Advanced Compile Options set to Target CPU of x86 (my workstation) but then initiated to run on a Microsoft Windows Server 2003 - Enterprise x64 Edition.  I needed to change this Target CPU setting in Application's Advanced Compile Options to x64 to run on the application server, or to value AnyCPU to run in both environments.

    Friday, September 23, 2011 3:14 PM