injesus Posted April 24, 2006 Share Posted April 24, 2006 HiSQL Analyzer show this errorServer: Msg 7399, Level 16, State 1, Line 2OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error. [OLE/DB provider returned message: The Microsoft Jet database engine could not find the object 'Book1$'. Make sure the object exists and that you spell its name and the path name correctly.]OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IColumnsInfo::GetColumnsInfo returned 0x80004005: ].The code is--Read Excel Sheet using OpenRowSetselect * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;DATABASE=c:\MyExcel.xls', 'Select * from [book1$]')is the system or the codethanks Link to comment Share on other sites More sharing options...
justsomeguy Posted April 24, 2006 Share Posted April 24, 2006 Book1 is the filename of the Excel workbook you want to use. If it's not called Book1, then use the correct name. Link to comment Share on other sites More sharing options...
injesus Posted April 24, 2006 Author Share Posted April 24, 2006 HiMyExel.xls is the name of my workbook and Book1 is the Worksheet.is correct the code syntax? Link to comment Share on other sites More sharing options...
justsomeguy Posted April 24, 2006 Share Posted April 24, 2006 Usually "Book#" applies to the workbook and "Sheet#" applies to each worksheet.The syntax is fine, the error is not about syntax, the error says it can't find "Book1". Link to comment Share on other sites More sharing options...
injesus Posted April 24, 2006 Author Share Posted April 24, 2006 I change the WorkSheet name to "Usuarios" and the error is the same.The Workbook file name is MyExel.xls, not is the problem? Link to comment Share on other sites More sharing options...
justsomeguy Posted April 24, 2006 Share Posted April 24, 2006 I'm not sure what you are working with there. This is the error message:The Microsoft Jet database engine could not find the object 'Book1$'. Make sure the object exists and that you spell its name and the path name correctly.This means that it is looking for something called "Book1" that could not be found. I assume that applies to the XLS file. If you need more help, you probably need to look up a reference for using SQL queries with office, look up help on the openrowset function. Link to comment Share on other sites More sharing options...
injesus Posted April 24, 2006 Author Share Posted April 24, 2006 ok the filename Workbook is MyExcel.xls, the Worksheet name is usuarios(now), and the code is.--Read Excel Sheet using OpenRowSetselect * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;DATABASE=c:\temp\MyExcel.xls', 'Select * from [usuarios]')Show me the errorServer: Msg 7399, Level 16, State 1, Line 2The Microsoft Jet database engine could not find the object 'usuarios'what's Wrongcan you help methanks Link to comment Share on other sites More sharing options...
justsomeguy Posted April 24, 2006 Share Posted April 24, 2006 You need to check the Microsoft Office help for the syntax how to reference that. It's probably something like MyExcel.usuarios or something like that, but I'm not sure. Link to comment Share on other sites More sharing options...
injesus Posted April 25, 2006 Author Share Posted April 25, 2006 (edited) I check the Microsoft Help and the error now is Server: Msg 7314, Level 16, State 1, Line 1OLE DB provider 'Microsoft.Jet.OLEDB.4.0' does not contain table 'Hoja1$'. The table either does not exist or the current user does not have permissions on that table.OLE DB error trace [Non-interface error: OLE DB provider does not contain the table: ProviderName=Microsoft.Jet.OLEDB.4.0', TableName='Hoja1$].My file name is c:\DISPCONF506.xls and the worksheet name is "Hoja1" Edited April 25, 2006 by injesus Link to comment Share on other sites More sharing options...
justsomeguy Posted April 25, 2006 Share Posted April 25, 2006 I don't know how to help with this, I've never used a SQL statement that references a Microsoft Office document. Link to comment Share on other sites More sharing options...
injesus Posted April 27, 2006 Author Share Posted April 27, 2006 Thank you already undefined . It is necessary to consider if the server is remote or local, if it is local there is no problem, but if it is external, it is necessary to copy it to the server so that he recognizes it.This code if it works:SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;HDR=Yes;Database=c:\este.xls', 'SELECT * FROM [sheet1$]')where "este.xls" is the file name in the computer server "C:\" path. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now