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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select from Excel error

Status
Not open for further replies.

DrewConn

Programmer
Jan 8, 2002
167
US
I need to insert records from an Excel sheet into a temp table in SQL without using DTS. I have tried the following:

Select * into NelNet_tmp FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=B:\MIS\MIS\Extracts\NelNet\MIPRIV 1282005(2).xls;HDR=YES',
'SELECT * FROM [Report1]')

But get this error:
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.
[OLE/DB provider returned message: Unspecified error]
OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005: ].


Any ideas either on this error or another way to do this?
 
If you know any VBA, you could do a simple macro inside the excel spreadsheet using ADO commands to connect to SQL and do the insert.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top