SQL Server – OPENROWSET – Error Reading XLS File – Cannot update. Database or object is read-only.

Tried using ACE to read an Excel (XLS) file


select *  
FROM   OPENROWSET
(
   'Microsoft.ACE.OLEDB.12.0'
   ,'Excel 8.0;Database=E:\Datafiles\Country.xl'  					 
   ,'select *  from [Sheet1$]'
)

Error Message:


"Microsoft.ACE.OLEDB.12.0" for linked server "(null)" returned message "Cannot update.  Database or object is read-only.".Msg 7303, Level 16, State 1, Line 1Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".

Resolution:

The problem was not read-only after all, but the issue was an incorrect filename.
The file name indicated is E:\Datafiles\Country.xl, but the actual’s file name is
E:\Datafiles\Country.xls

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s