February 28, 2017 at 6:30 am
Error using SQL login :Continue ...
7) SQL AGENT and SQL services are running using Service account .
Service account is in administrator group. Also having Full access to the folder from where we are reading Excel.
ERROR I AM GETTING WHILE EXECUTING IT USING NON SYSADMIN SQL LOGIN AND WINDOW LOGIN HAVING ADMIN RIGHTS
1) xp_cmdshell 'type "L:\Linked Server\EXCEL.xls"'
--- I can see data, but not in readable format for non sysadmin SQL login and Windows login
2) select * from OPENROWSET('MICROSOFT.ACE.OLEDB.12.0',
'Excel 8.0;HDR=YES;DATABASE=L:\Linked Server\RT_CargaPolizas.xls',sheet$)
--- Using SQL LOGIN :
Msg 7415, Level 16, State 1, Line 9
Ad hoc access to OLE DB provider 'MICROSOFT.ACE.OLEDB.12.0' has been denied. You must access this provider through a linked server.
-- Using Windows login
OLE DB provider "MICROSOFT.ACE.OLEDB.12.0" for linked server "(null)" returned message "Unspecified error".
Msg 7303, Level 16, State 1, Line 8
Cannot initialize the data source object of OLE DB provider "MICROSOFT.ACE.OLEDB.12.0" for linked server "(null)".
3) SELECT * FROM OPENQUERY(ExcelServer2, 'SELECT * FROM [Sheet$]')
--- Using SQL LOGIN
Msg 7416, Level 16, State 2, Line 12
Access to the remote server is denied because no login-mapping exists.
-- Using Windows login
OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "ExcelServer2" returned message "Unspecified error".
Msg 7303, Level 16, State 1, Line 11
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "ExcelServer2".
4) SELECT * FROM OPENDATASOURCE('Microsoft.ACE.OLEDB.12.0',
'Data Source=L:\Linked Server\EXCEL.xls;Extended Properties=Excel 8.0')...Sheet$
--- Using SQL LOGIN
Msg 7415, Level 16, State 1, Line 14
Ad hoc access to OLE DB provider 'Microsoft.ACE.OLEDB.12.0' has been denied. You must access this provider through a linked server.
-- Using Windows login
OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" returned message "Unspecified error".
Msg 7303, Level 16, State 1, Line 13
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".
5) SELECT * FROM ExcelServer2...[Sheet$]
--- Using SQL LOGIN
Msg 7416, Level 16, State 2, Line 19
Access to the remote server is denied because no login-mapping exists.
-- Using Windows login
OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "ExcelServer2" returned message "Unspecified error".
Msg 7303, Level 16, State 1, Line 18
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "ExcelServer2".
6) SELECT * FROM OPENQUERY(LINKEDSERVERNAME, 'SELECT * FROM [Sheet$]')
--- Using SQL LOGIN
Msg 7416, Level 16, State 2, Line 14
Access to the remote server is denied because no login-mapping exists.
-- Using Windows login
OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "DBL_POLIZAS" returned message "Unspecified error".
Msg 7303, Level 16, State 1, Line 19
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "DBL_POLIZAS".
February 28, 2017 at 7:46 am
sp_configure 'Ad Hoc Distributed Queries'
But in all of that writing over and over, you never did answer the second questions. You just need to execute the following: EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0'
No offense but you seem to be totally lost on all of this. It would be better for you to understand linked servers, linked server properties, providers - what they are and how they play a part in all of this, what the provider and linked server settings need to be for different options, etc. If you don't get your head around that you can't support the linked server. After you understand more of what linked servers are and how they work and need to be configured, you can walk through an Excel linked server in this article:
Excel Import to SQL Server using Linked Servers
Sue
March 1, 2017 at 10:45 am
HI Sue,
Actually we are trying to coonect using non admin sql login having developer access.
SELECT * FROM OPENQUERY(ExcelServer1, 'SELECT * FROM [Sheet1$]')
While executing it using SQL login it giving error as :
"Access to remote server denied because no login mapping exist."
As per the link you have shared Everything is in place the only doubt is as per link it
providing access to temp drive but that is for 32 bit server .
And the server where I am trying is 64 bit.
Still getting error .
Regards,
Megha Chandak
March 1, 2017 at 8:18 pm
Okay...still don't know what the provider settings are so execute this - you need to change the name of the linked server to whatever you need it to be and you need to change the path to the Excel file.
EXEC master . dbo. sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0' , N'AllowInProcess' , 1
GO
EXEC master . dbo. sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0' , N'DynamicParameters' , 1
GO
EXEC master.dbo.sp_addlinkedserver
@server = N'YourLinkedServerName',
@srvproduct=N'ACE 12.0',
@provider=N'Microsoft.ACE.OLEDB.12.0',
@datasrc=N'X:\PathToYour\File.xlsx',
@provstr=N'Excel 12.0;HDR=Yes'
GO
EXEC master.dbo.sp_addlinkedsrvlogin
@rmtsrvname=N'YourLinkedServerName',
@useself=N'False',
@locallogin=NULL,
@rmtuser=N'Admin'
Sue
March 3, 2017 at 5:54 am
Hi sue,
Thanks you very much .
I am stuck in this issue from long time.
the mistake I was doing is @rmtuser = Admin .
I was mentioning rmtuser as " sa or Windows" login.
Thanks a ton. you have made by day. thank you.
Regards,
Megha chandak
March 3, 2017 at 6:00 am
HI Sue ,
one question ... Can we implemnt this on prod . Will it be any security constraint if we mention @rmtuser as Admin.
Regards,
Megha Chandak
March 3, 2017 at 6:06 am
HI Sue,
A quick question .. if we mention @rmtuser as admin which login it will refer while executing linked server.
Also can we implement in production also there will not be any security issue.
Regards,
Megha Chandak
March 3, 2017 at 7:36 am
Sue
March 6, 2017 at 2:54 am
OK thanks a lot.
February 2, 2023 at 10:55 pm
In response to @sue she provided the correct information for me
THE USER NAME TO PROCIDE TO AN EXCEL FILE IS
User: Admin
No pasword
My linked server is an xlsx using ACE driver
Works fine from SSMS in a view accessing the remote server but from an SSRS report I got a login error
Simply providing
"Be made usiing this security context"
Remote login: admin
With password: (none)
the SSRS report was able to run the view
Viewing 10 posts - 16 through 24 (of 24 total)
You must be logged in to reply to this topic. Login to reply