Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Getting ODBC source error

Getting ODBC source error

Scheduled Pinned Locked Moved ASP.NET
visual-studiohelpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Satish Developer
    wrote on last edited by
    #1

    Hi, i have developed one website. When i try to run it from VS 2005 it runs fine. I hosted the website in my local machine instead of running from VS 2005. It also works fine for 2 to 3 pages. But its getting error in one page where that page reads data from csv file using odbc connection. I am getting error as "IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified " while executing diretly instead of vs 2005. The same page executes fine when i run from vs2005. What's the thing i need to do to execute in other way ?

    G. Satish

    S 1 Reply Last reply
    0
    • S Satish Developer

      Hi, i have developed one website. When i try to run it from VS 2005 it runs fine. I hosted the website in my local machine instead of running from VS 2005. It also works fine for 2 to 3 pages. But its getting error in one page where that page reads data from csv file using odbc connection. I am getting error as "IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified " while executing diretly instead of vs 2005. The same page executes fine when i run from vs2005. What's the thing i need to do to execute in other way ?

      G. Satish

      S Offline
      S Offline
      senguptaamlan
      wrote on last edited by
      #2

      can you please provide the code (specially when you are making the connection using ODBC)

      S 1 Reply Last reply
      0
      • S senguptaamlan

        can you please provide the code (specially when you are making the connection using ODBC)

        S Offline
        S Offline
        Satish Developer
        wrote on last edited by
        #3

        Note: This works fine when i run the applicaiton from vs 2005. But only getting problem while i am running the application by hosting it on same machine. if (_fileexten == ".csv") { string str = Path.GetFileName(_filename); OdbcConnection conn = new OdbcConnection("Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + _fpath + "\\;Extensions=asc,csv,tab,txt;Extended Properties=\"HDR=YES;IMEX=1;\";Persist Security Info=False"); conn.Open(); string sql_select = "select FirstName, LastName, MiddleName, Zip from [" + str + "]"; OdbcDataAdapter myCommand = new OdbcDataAdapter(sql_select, conn); myCommand.Fill(myDataSet, "csv"); dt = myDataSet.Tables[0]; conn.Close(); myCommand.Dispose(); }

        G. Satish

        S 1 Reply Last reply
        0
        • S Satish Developer

          Note: This works fine when i run the applicaiton from vs 2005. But only getting problem while i am running the application by hosting it on same machine. if (_fileexten == ".csv") { string str = Path.GetFileName(_filename); OdbcConnection conn = new OdbcConnection("Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + _fpath + "\\;Extensions=asc,csv,tab,txt;Extended Properties=\"HDR=YES;IMEX=1;\";Persist Security Info=False"); conn.Open(); string sql_select = "select FirstName, LastName, MiddleName, Zip from [" + str + "]"; OdbcDataAdapter myCommand = new OdbcDataAdapter(sql_select, conn); myCommand.Fill(myDataSet, "csv"); dt = myDataSet.Tables[0]; conn.Close(); myCommand.Dispose(); }

          G. Satish

          S Offline
          S Offline
          senguptaamlan
          wrote on last edited by
          #4

          It seems a bit weired problem. Check the ODBC configuration for all the available drivers, and check whether the Microsoft Text Driver is installed on the machine or not. You will find the ODBC Datasource ADministrator from Administrative Tools.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups