Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends
This is my stored procedure
SQL
alter procedure sp_excelforgeneralholidays(@filname nvarchar(max))
 as
 declare @datavar nvarchar(max)
 declare @sql varchar(1000)
 set @datavar  = 'Excel 8.0;Database=' + @filname

 set nocount on
  begin
  --create table #temptable (Date date ,Day varchar(30),Reason varchar(100))
  set @sql = 'SELECT * FROM OPENROWSET(''Microsoft.jet.OLEDB.4.0'',''+@datavar+;HDR=YES'',''SELECT Date,Day,Reason FROM [Sheet1$]'')'

  exec (@sql)
 end


This is my execution part of my stored procedure
exec sp_excelforgeneralholidays 'D:\testing'


This is the error
OLE DB provider "Microsoft.jet.OLEDB.4.0" for linked server "(null)" returned message "Could not find installable ISAM.".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "Microsoft.jet.OLEDB.4.0" for linked server "(null)".

please check this stored procedure.
Posted

1 solution

I googled the error message and found this[^], with people saying it solved this issue, too. Basically, using "Regsvr32 c:\winnt\system32\msexcl40.dll" (with the correct path to the dll) reregisters the dll and fixes the issue.
 
Share this answer
 
Comments
[no name] 24-Aug-12 10:03am    
What a wonderous thing this "google" must be. Someone should write an article.... :-)
Christian Graus 24-Aug-12 10:05am    
You know, I think someone has.... :P
baskaran chellasamy 24-Aug-12 10:18am    
I check with this tutorial.And i found there is msexcl40.dll on two location.
1.C:\Windows\System32 The exact place to for this dll
2.C:\Windows\winsxs\x86_microsoft-windows-m..components-jetexcel_31bf3856ad364e35_6.1.7600.16385_none_1de500b1a390aab9

Is any problem will occur ragarding with these two location
thanks for advance
Christian Graus 24-Aug-12 10:21am    
My guess is that this means the issue is that you don't have Excel installed
baskaran chellasamy 24-Aug-12 10:35am    
sorry friends this is working.
<pre>create procedure sp_exceltest
as
set nocount on
declare @sql varchar(2000)
begin
set @sql='select * from OPENROWSET(''Microsoft.jet.OLEDB.4.0'',''Excel 8.0;Database=D:\testing.xls;HDR=YES'',''select * from [Sheet1$]'')'
exec(@sql)
end</pre>
But the above is not working.please find if i made with any syntax error

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900