An error occurred while sorting out the SQL Server OpenDataSource OpenRowSet connection to excel.

Source: Internet
Author: User

One TB-SQL

Select * From OpenDataSource
('Microsoft. Jet. oledb.4.0 ',
'Data source = "C:/test2.xls"; user id = admin; Password =; extended properties = Excel 8.0 ')... [ta $]

 

Select * From OpenRowSet
('Microsoft. Jet. oledb.4.0 ', 'excel 8.0; database = C:/test2.xls', [ta $])

1. When Excel has been opened:
-- 2005
Server: Message 7399, level 16, status 1, Row 1
The ole db access interface "Microsoft. Jet. oledb.4.0" of the linked server "(null)" reports an error. The provider does not provide any information about the error.
Server: Message 7303, level 16, status 1, Row 1
You Cannot initialize the data source object of the ole db access interface "Microsoft. Jet. oledb.4.0" of the linked server "(null.
-- 2000
Server: Message 7399, level 16, status 1, Row 1
The ole db Provider 'Microsoft. Jet. oledb.4.0 'reports an error. The provider does not provide any information about the error.
Ole db Error Tracking [OLE/DB Provider 'Microsoft. Jet. oledb.4.0 'idbinitialize: Initialize returned 0x80004005: The provider does not provide any information about the error.]

 

2. There is no TA tag in execl:
-- 2005
Server: Message 7314, level 16, status 1, Row 3
The ole db access interface of the linked server "(null)" "Microsoft. Jet. oledb.4.0" does not contain the table "ta $ ". The table does not exist, or the current user does not have the permission to access the table.
-- 2000
Server: Message 7314, level 16, status 1, Row 1
The ole db Provider 'Microsoft. Jet. oledb.4.0 'does not contain the table 'ta $ '. The table may not exist, or the current user does not have the permission to use the table.
Ole db Error Tracking [non-interface error: ole db provider does not contain the table: providername = 'Microsoft. Jet. oledb.4.0 ', tablename = 'ta $'].

3. the Excel file does not exist:
-- 2005
Server: Message 7399, level 16, status 1, Row 1
The ole db access interface "Microsoft. Jet. oledb.4.0" of the linked server "(null)" reports an error. The provider does not provide any information about the error.
Server: Message 7303, level 16, status 1, Row 1
You Cannot initialize the data source object of the ole db access interface "Microsoft. Jet. oledb.4.0" of the linked server "(null.
-- 2000
Server: Message 7314, level 16, status 1, Row 1
The ole db Provider 'Microsoft. Jet. oledb.4.0 'does not contain the table 'ta $ '. The table may not exist, or the current user does not have the permission to use the table.
Ole db Error Tracking [non-interface error: ole db provider does not contain the table: providername = 'Microsoft. Jet. oledb.4.0 ', tablename = 'ta $'].

 

 

Another 2005 required

-- Enable ad hoc distributed queries first:
Exec sp_configure 'show advanced options', 1
Reconfigure
Exec sp_configure 'ad hoc distributed queries ', 1
Reconfigure

-- Disable ad hoc distributed queries after use:
Exec sp_configure 'ad hoc distributed queries ', 0
Reconfigure
Exec sp_configure 'show advanced options', 0
Reconfigure

 

 

NTFS directory and file permission settings can also cause problems

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.