none
Erro ao importar CVS RRS feed

  • Pergunta

  • Quando tento ler um arquivo CVS no servidor acontece o seguinte erro 

    ERROR [HY000] [Microsoft][ODBC Text Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x16b4 Thread 0x13cc DBC 0x1921d7c Text'.
    ERROR [01S00] [Microsoft][ODBC Text Driver]Invalid connection string attribute Persist Security Inf
    ERROR [01S00] [Microsoft][ODBC Text Driver]Invalid connection string attribute Persist Security Inf
    ERROR [01S00] [Microsoft][ODBC Text Driver]Invalid connection string attribute Persist Security Inf
    ERROR [01S00] [Microsoft][ODBC Text Driver]Invalid connection string attribute Persist Security Inf
    ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed
    ERROR [HY000] [Microsoft][ODBC Text Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x16b4 Thread 0x13cc DBC 0x1921d7c Text'.
    ERROR [01S00] [Microsoft][ODBC Text Driver]Invalid connection string attribute Persist Security Inf
    ERROR [01S00] [Microsoft][ODBC Text Driver]Invalid connection string attribute Persist Security Inf
    ERROR [01S00] [Microsoft][ODBC Text Driver]Invalid connection string attribute Persist Security Inf
    ERROR [HY024] [Microsoft][ODBC Text Driver] '(unknown)' is not a valid path.  Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
    ERROR [01S00] [Microsoft][ODBC Text Driver]Invalid connection string attribute Persist Security Inf
    ERROR [01S00] [Microsoft][ODBC Text Driver]Invalid connection string attribute Persist Security Inf
    ERROR [01S00] [Microsoft][ODBC Text Driver]Invalid connection string attribute Persist Security Inf
    ERROR [01S00] [Microsoft][ODBC Text Driver]Invalid connection string attribute Persist Security Inf
    ERROR [HY000] [Microsoft][ODBC Text Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x16b4 Thread 0x13cc DBC 0x1921d7c Text'.
    ERROR [HY000] [Microsoft][ODBC Text Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x16b4 Thread 0x13cc DBC 0x1921d7c Text'.
    ERROR [01S00] [Microsoft][ODBC Text Driver]Invalid connection string attribute Persist Security Inf
    ERROR [01S00] [Microsoft][ODBC Text Driver]Invalid connection string attribute Persist Security Inf
    ERROR [01S00] [Microsoft][ODBC Text Driver]Invalid connection string attribute Persist Security Inf
    ERROR [HY024] [Microsoft][ODBC Text Driver] '(unknown)' is not a valid path.  Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

    Executado local o código funciona normalmente!


    Código abaixo
     string strConnCVS = @"Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + Path.GetDirectoryName(fluExcel.PostedFile.FileName) + ";Extensions=asc,csv,tab,txt;Persist Security Info=True"; //;Persist Security Info=False
    
                //Connection file
                DataSet dts = new DataSet();
                using (OdbcConnection oConn = new OdbcConnection(strConnCVS))
                {
                    oConn.Open();
    
                    //Command select
                    string table = Path.GetFileName(fluExcel.PostedFile.FileName);
                    OdbcCommand oCmd = new OdbcCommand("select * from " + table, oConn);
                    OdbcDataReader dtr = oCmd.ExecuteReader();
               }
    


    Riderman
    terça-feira, 23 de junho de 2009 13:04

Todas as Respostas

  • Olá,


    Qual o valor desta que este método esta retonando ? Path.GetDirectoryName(fluExcel.PostedFile.FileName)


    Abraço,
    Nelson Borges - http://nelsonborgesjr.spaces.live.com/blog/
    quarta-feira, 24 de junho de 2009 03:20