| Author |
Topic |
|
ganeshkumar08
Posting Yak Master
187 Posts |
Posted - 2010-04-13 : 02:28:53
|
| Hi,This is my SP-- sp_ImportFromExcel03 'Sheet1','D:\testing.xls','YES','Test'ALTER PROCEDURE [dbo].[sp_ImportFromExcel03] @SheetName varchar(20), @FilePath varchar(100), @HDR varchar(3), @TableName varchar(50)ASBEGIN DECLARE @SQL nvarchar(1000) IF OBJECT_ID (@TableName,'U') IS NOT NULL SET @SQL = 'INSERT INTO ' + @TableName + ' SELECT * FROM OPENDATASOURCE' ELSE SET @SQL = 'SELECT * INTO ' + @TableName + ' FROM OPENDATASOURCE' SET @SQL = @SQL + '(''Microsoft.Jet.OLEDB.4.0'',''Data Source=' SET @SQL = @SQL + @FilePath + ';Extended Properties=''''Excel 8.0;HDR=' SET @SQL = @SQL + @HDR + ''''''')...[' SET @SQL = @SQL + @SheetName + ']' EXEC sp_executesql @SQL-- Print @SQLENDAfter executing sp_ImportFromExcel03 'Sheet1','D:\testing.xls','YES','Test'I am getting below error.Msg 7399, Level 16, State 1, Line 1The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.Msg 7303, Level 16, State 1, Line 1Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".How can i resolve it.ThanksGaneshSolutions are easy. Understanding the problem, now, that's the hard part |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
Sachin.Nand
2937 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-04-13 : 04:58:24
|
quote: Originally posted by Idera
quote: Originally posted by madhivanan More trobleshootinghttp://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926MadhivananFailing to plan is Planning to fail
Wow thats a hell lot of troubleshooting of 25 pages.PBUH
People have different types of problems when trying to exporting to EXCEL. That link has informations to almost all the problemsMadhivananFailing to plan is Planning to fail |
 |
|
|
ganeshkumar08
Posting Yak Master
187 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-04-13 : 07:02:48
|
| What does this return?Print @SQLMadhivananFailing to plan is Planning to fail |
 |
|
|
ganeshkumar08
Posting Yak Master
187 Posts |
Posted - 2010-04-14 : 02:48:49
|
| Print @SQL will returnINSERT INTO Test SELECT * FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0','Data Source=D:\testing.xls;Extended Properties=''Excel 8.0;HDR=YES''')...[Sheet1]Solutions are easy. Understanding the problem, now, that's the hard part |
 |
|
|
ganeshkumar08
Posting Yak Master
187 Posts |
Posted - 2010-04-14 : 07:17:57
|
| I got solution.We need to put the excel file in one folder. We should not save or copy excel file in Hard Drives(C:\, D:\,....) we have to save as DriveName:\FolderName\ExcelFileName.xlsi.e, c:\TestFolder\Test.xlsSolutions are easy. Understanding the problem, now, that's the hard part |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-04-15 : 02:36:43
|
quote: Originally posted by ganeshkumar08 I got solution.We need to put the excel file in one folder. We should not save or copy excel file in Hard Drives(C:\, D:\,....) we have to save as DriveName:\FolderName\ExcelFileName.xlsi.e, c:\TestFolder\Test.xlsSolutions are easy. Understanding the problem, now, that's the hard part
Ok. Thanks for the feedback MadhivananFailing to plan is Planning to fail |
 |
|
|
|