Reading from Excel (quick question)
-
Hi, i have a quick question. I have an application installed in a server that reads from Excel, is it necesary to have installed Excel so the application can read the excel files??
It depends on what you mean by "Excel files", and how they are being read. If you mean comma separated value files (*.CSV) that a user might open in Excel, then no, you don't need Excel to read them. If you mean files saved in the Excel format (*.xls), then the answer is "maybe", and you would need to give more information about the server-side component that reads the files. If it uses some form of MS Office automation (which would interop with the Excel runtime callable COM wrappers), then you would need at least some parts of Excel installed on the server. However, if the server component is using the Jet database engine or some other proprietary driver(s) for accessing Excel, the requirement for installing Excel in and of itself is removed, however a new requirement may arise to support the component(s) reading the spreadsheets (Jet used to require some add-on components to intrepret Excel - don't know if they're a requirement any more, or if they are just installed automatically with Jet). Hope this helps.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
-
It depends on what you mean by "Excel files", and how they are being read. If you mean comma separated value files (*.CSV) that a user might open in Excel, then no, you don't need Excel to read them. If you mean files saved in the Excel format (*.xls), then the answer is "maybe", and you would need to give more information about the server-side component that reads the files. If it uses some form of MS Office automation (which would interop with the Excel runtime callable COM wrappers), then you would need at least some parts of Excel installed on the server. However, if the server component is using the Jet database engine or some other proprietary driver(s) for accessing Excel, the requirement for installing Excel in and of itself is removed, however a new requirement may arise to support the component(s) reading the spreadsheets (Jet used to require some add-on components to intrepret Excel - don't know if they're a requirement any more, or if they are just installed automatically with Jet). Hope this helps.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
-
I am using the jet database engine. I installed an excel viewer but still give me the error. The problem is that the error says: "No error information available: E_FAIL(0x80004005)"...What else could i try?
You did not previously indicate that you were having a problem or receiving any exception information, so it was a little difficult to give you specific advice. I don't know what you mean by "Excel Viewer", but if you mean one of the GUI applications that allows viewing Office documents without having all of Office installed, it's unlikely to make a difference. You need (to share) more information about the server-side component that's trying to read the Excel spreadsheets. As I mentioned before, your results are highly dependent upon what that component is doing. There is no way to give you any considered advice without knowing what the "reader" component is doing and how. I can give you suggestions based upon the error number you're receiving, but they are not likely to yield much in the way of actual help - you can look up the error number (0x80004005) at: http://support.microsoft.com[^] There are numerous hits there, because the error number covers quite a bit of error-related real estate. The first item pertains to the Jet engine, and the fact that if connection properties are not correctly set (using, say, an OleDbConnection with Jet), then the specified error code might return, indicating a failure to find an ISAM. Somewhere to start, anyway.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
-
You did not previously indicate that you were having a problem or receiving any exception information, so it was a little difficult to give you specific advice. I don't know what you mean by "Excel Viewer", but if you mean one of the GUI applications that allows viewing Office documents without having all of Office installed, it's unlikely to make a difference. You need (to share) more information about the server-side component that's trying to read the Excel spreadsheets. As I mentioned before, your results are highly dependent upon what that component is doing. There is no way to give you any considered advice without knowing what the "reader" component is doing and how. I can give you suggestions based upon the error number you're receiving, but they are not likely to yield much in the way of actual help - you can look up the error number (0x80004005) at: http://support.microsoft.com[^] There are numerous hits there, because the error number covers quite a bit of error-related real estate. The first item pertains to the Jet engine, and the fact that if connection properties are not correctly set (using, say, an OleDbConnection with Jet), then the specified error code might return, indicating a failure to find an ISAM. Somewhere to start, anyway.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
This my string conexion: strConection = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" l.xls@";Extended Properties=Excel 8.0;"; then i build the object: OleDbConnection oConection = new OleDbConnection(strConection); and open the conection: oConexion.Open();--->HERE IS WHERE I GET THE RROR In my server i have installed: Microsoft Office Excel Viewer 2003 In my Data Sources(ODBC) i have no USER DSN, SYSTEM DSN In my drivers I have Driver do Microsoft Excel (4.00.6200) and Microsoft Excel Driver (4.00.6200) What other information i can give u? Thanks for all the help
-
This my string conexion: strConection = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" l.xls@";Extended Properties=Excel 8.0;"; then i build the object: OleDbConnection oConection = new OleDbConnection(strConection); and open the conection: oConexion.Open();--->HERE IS WHERE I GET THE RROR In my server i have installed: Microsoft Office Excel Viewer 2003 In my Data Sources(ODBC) i have no USER DSN, SYSTEM DSN In my drivers I have Driver do Microsoft Excel (4.00.6200) and Microsoft Excel Driver (4.00.6200) What other information i can give u? Thanks for all the help
Okay. First, put double-quotes around your
Extended Properties
value array. This requirement is not documented, but the lack of quotations around theExtended Properties
will mess up the parsing of the connection string (nice, huh? Love those semicolons - the universal separator :)) resulting in the exception you're seeing. See below for an example connection string that's confirmed working... Now, if that doesn't do it: I don't have a PC without Excel on it at the moment, but I did make a little sample application to read data from Excel spreadsheets. I used the connection string:string connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"c:\\mydocument.xls\";Extended Properties=\"Excel 8.0;HDR=Yes;\"";
in my application. One difference is the addition of the HDR extended property. You could also alternately choose to use IMEX as an extended property, but I don't think they'd make a lot of difference, but might be worth a try:
"HDR=Yes;" indicates that the first row contains columnnames, not data "IMEX=1;" tells the driver to always read "intermixed" data columns as text
Failing all other solutions to your exception problem, I would have to guess that your server has a damaged or missing Indexed Sequential Access Method (ISAM) driver for Excel. There's an article here[^] that discusses how the Jet Db engine is used to access Excel workbooks. Here[^] is a link dealing with how to repair missing/corrupted ISAM files. I hope this helps - after this I've got nothing...The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
-
Okay. First, put double-quotes around your
Extended Properties
value array. This requirement is not documented, but the lack of quotations around theExtended Properties
will mess up the parsing of the connection string (nice, huh? Love those semicolons - the universal separator :)) resulting in the exception you're seeing. See below for an example connection string that's confirmed working... Now, if that doesn't do it: I don't have a PC without Excel on it at the moment, but I did make a little sample application to read data from Excel spreadsheets. I used the connection string:string connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"c:\\mydocument.xls\";Extended Properties=\"Excel 8.0;HDR=Yes;\"";
in my application. One difference is the addition of the HDR extended property. You could also alternately choose to use IMEX as an extended property, but I don't think they'd make a lot of difference, but might be worth a try:
"HDR=Yes;" indicates that the first row contains columnnames, not data "IMEX=1;" tells the driver to always read "intermixed" data columns as text
Failing all other solutions to your exception problem, I would have to guess that your server has a damaged or missing Indexed Sequential Access Method (ISAM) driver for Excel. There's an article here[^] that discusses how the Jet Db engine is used to access Excel workbooks. Here[^] is a link dealing with how to repair missing/corrupted ISAM files. I hope this helps - after this I've got nothing...The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’