baskaran chellasamy

baskaran chellasamy

  • NA
  • 114
  • 150.1k

sql procedure issue on second time

Aug 24 2012 4:11 AM
Hi friends
  This is my stored procedure
alter procedure sp_excelfortest
 as 
 declare @sql varchar(500)
 set nocount on
  begin
  Set @sql ='select * FROM OPENROWSET(''Microsoft.Jet.OLEDB.4.0'',
 ''Excel 8.0;Database=D:\baskarbook1.xls;HDR=YES;'',
  ''SELECT * FROM [Sheet1$]'')'
  exec (@sql)
 end
 This is works one time successfully.

but when i restart my sql server it display this error

OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" returned message "Unspecified error".
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)".

I read some article about this error but i didnt get a exact answer for my problem.please help me




Answers (1)