Getting ODBC source error
-
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
-
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
can you please provide the code (specially when you are making the connection using ODBC)
-
can you please provide the code (specially when you are making the connection using ODBC)
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
-
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
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.