Cari Blog Ini

20 Juni 2012

OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005

Error Messages :


Server: Msg 7399, Level 16, State 1, Line 1 

OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error. 

The provider did not give any information about the error. 

OLE DB error trace 

[OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005:  

The provider did not give any information about the error.].



* * * * *





First condition of file Excel, name "Results.xls":


Case:
* When run query in Point A, there is an error messages in Point B

Point A : Query:
------------------------------------------------------------------
-----code:start
------------------------------------------------------------------
SELECT *
FROM OPENROWSET
    ('Microsoft.Jet.OLEDB.4.0',
    'Excel 8.0;
    Database=D:\Results.xls',
    'SELECT KdCabang,Cabang FROM [Results$]')
------------------------------------------------------------------
-----code:end
------------------------------------------------------------------


Point B : Error Messages:
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.
The provider did not give any information about the error.
OLE DB error trace
[OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005: 
The provider did not give any information about the error.].


The error messages in "Point B" happened because:
* File excel, name "Results.xls", as type "Text (Tab Delimited)"


Solution:
* Could "Save As" again file excel, name "Results.xls" to new file excel as type : "Microsoft Office Excel Workbook"
Example: New File Excel, name: "Results_1.xls"

* Then run a new query in Point C



Point C : Query:
------------------------------------------------------------------
-----code:start
------------------------------------------------------------------
SELECT *
FROM OPENROWSET
    ('Microsoft.Jet.OLEDB.4.0',
    'Excel 8.0;
    Database=D:\Results_1.xls',
    'SELECT KdCabang,Cabang FROM [Results$]')
------------------------------------------------------------------
-----code:end
------------------------------------------------------------------

Result Messages:
KdCabang                                              Cabang
-----------------------------------------
5.0                                                   BSD                         
2.0                                                   JAYAKARTA              
3.0                                                   KEBON JERUK            
4.0                                                   KELAPA GADING        
7.0                                                   SURABAYA                
6.0                                                   BANDUNG                 
1.0                                                   PUSAT                      
8.0                                                   SEMARANG               

(8 row(s) affected)