.NET Framework Bookmark and Share   
 index > 64-Bit .NET Framework Development > How to Import Excel Data into SQL Server 2008(64 bit) Using SQL Query (in Windows Server 2008 64bit environment)
 

How to Import Excel Data into SQL Server 2008(64 bit) Using SQL Query (in Windows Server 2008 64bit environment)

I am developing VB .Net application in Visual Studio 2008(64bit), SQL Server 2008(64bit) and Windows Server 2008(64bit) environment.

I need to import an Excel and Flat files data into SQL Server database using SQL Query. I tried a lot with the following SQL Queries directly with SQL Server Management Studio,

1. SELECT * INTO  dbo.ExcelImportTest FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=D:\PTPLDCT\DCT Test Datasource\DCT_Excel_Test_Sample_1.xls',
'select * from [Sheet1$]')

While executing i got an error as below,

Msg 7403, Level 16, State 1, Line 1
The OLE DB provider "Microsoft.Jet.OLEDB.4.0" has not been registered.

2. I have also tried with MSDASQL provider,

Select * from openrowset('MSDASQL','Driver={Microsoft Excel Driver (*.xls)};
Dbq=DCT_Excel_Test_Sample_1.xls;DefaultDir=D:\PTPLDCT\DCT Test Datasource\', 'Select * from [Sheet1$]')

Then i encountered the following error,

OLE DB provider "MSDASQL" for linked server "(null)" returned message "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "(null)".

3. Finally i have tried the Query with Linked Server,

EXEC sp_addlinkedserver @server = 'Excel_Linked_Server',
@srvproduct = 'MSDASQL',
@provider = 'MSDASQL',
@datasrc = 'D:\PTPLDCT\DCT Test Datasource\DCT_Excel_Test_Sample_1.xls'


Then, i encountered the following error,

OLE DB provider "MSDASQL" for linked server "Excel_Linked_Server" returned message "[Microsoft][ODBC Driver Manager] Data source name too long".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "Excel_Linked_Server".


Please anyone help me to solve these issues.


Thanks in Advance,

Jaffar Rabeek


Jaffar_PTPL
Hello Jaffar,

Have you been able to find a solution yet? I am facing the same problem!

Thanks,
Gaurav
GauravMahajan
Hi Gaurav,


Still i am not finding any solution for that. I will let you know, if find any solution. If you find any solution earlier, then please let me know about it.


Thanks,

Jaffar Rabeek
Jaffar_PTPL
Any solutions guys...

Only things I have seen so far

create an (x86) windows service and expose the methods....
from your exe remote call the exposed methods then you will be able to use the oledb dataproviders...
Yuck...
SSIS 32 mode
Yuck...
this..
http://my.opera.com/Comicsken/blog/2009/04/23/reading-an-excel-file-on-a-64-bit-server




wpageiii

You can use google to search for other answers

Custom Search

More Threads

• Deploying "anycpu" assembly as 32 bit
• Visual Studio Compilation Error - LC.EXE
• 64 bit Windows server 2008 OS Production server with .Net Framework 2.0
• owc11 download to excel functionality
• deploying on 64-bit
• Problem displaying Binary Data in x64 server
• Why MFC project manifest includes Microsoft.Windows.Common-Controls dependentAssembly and others don't?
• Error while accessing a COM Component
• Error calling 32-bit DLL from x86-targeted .NET app in 64 bit Windows
• URGENT:Resolution Problem