Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

excel to sql server (openrowset)

Status
Not open for further replies.

baran121

Programmer
Sep 8, 2005
337
TR
Hi

I am getting the error when i am trying to extract records from Excel to a SQL 2000 Database using VB program.

I am using the openrowset.

server :windows 2000 or 2003
office on server :xp
office on clients :2003

Error : -2147217900 : 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.].

I do not get any error when i am trying the same on server.

Please advice
 
Hi,
Could you post the code you're using?

Maybe the problem is in the connection when opening the excel file or it's not in the same location in the client computer.


David
 
code1:

SELECT MSTK,URUN,ISNULL(MKTR,1) as MKTR,BRM,YUKTRH,ISNULL(SASNO,1) as SASNO
FROM OpenDataSource( Microsoft.Jet.OLEDB.4.0',
'Data Source=D:\den.xls; User ID=Admin;Password=;Extended properties=Excel 8.0' )... Sheet1$
ORDER BY MSTK,YUKTRH

code2:
SELECT MSTK,URUN,ISNULL(MKTR,1) as MKTR,ISNULL(BRM,'ADT') as BRM,YUKTRH,ISNULL(SASNO,1) as SASNO FROM
OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=D:\den.xls',
'SELECT * FROM [Sheet1$] ORDER BY MSTK,YUKTRH')

i got same error .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top