Operating System does not recognize installed OLE DB provider - sql-server

I have a 32 bit Windows 7 machine.
I am trying to access an excel sheet by creating a linked server in SQL Server 2012.
Below is my error.
Msg 7403, Level 16, State 1, Line 1
The OLE DB provider "Microsoft.ACE.OLEDB.12.0" has not been registered.
The control panel's Programs And Features say the Microsoft Access Database Engine 2010 is available.
How do I solve this issue?
SQL CONNECTION STRING and a QUERY:
EXEC sp_addlinkedserver
#server = 'ExcelServer2',
#srvproduct = 'Excel',
#provider = 'Microsoft.ACE.OLEDB.12.0',
#datasrc = 'D:\MyFTP\Jul19\FAILED\DCSDIM.xlsx',
#provstr = 'Excel 12.0;IMEX=1;HDR=YES;'
SELECT * FROM ExcelServer2...DCSDIM
PROVIDERS:

Install the 64 - bit provider on the server from redis.
Use the above-mentioned provider to invoke the SQL Server which is a 64 - bit executable.
It does not matter what provider you have on the local computer to execute SSMS.
Office11 is the internal name for Office 2003.
Office12 for Office 2007, and
Office14 for Office 2010
After you installed the redis package for Office 2010 you need to change your code as follows:
EXEC sp_addlinkedserver
#server = 'ExcelServer2',
#srvproduct = 'Excel',
#provider = 'Microsoft.ACE.OLEDB.14.0',
#datasrc = 'D:\MyFTP\Jul19\FAILED\DCSDIM.xlsx',
#provstr = 'Excel 14.0;IMEX=1;HDR=YES;'
SELECT * FROM ExcelServer2...DCSDIM

Related

SQL Server 2019 Polybase error - cant create External Data Source to SQL Server 2019

I am trying to setup an external data source in SQL Server 2019 to another database on the same server.
I am doing this to replicate the SQL Azure setup currently running in production.
I tried the following to set it up
I installed SQL Server 2019 Express
I installed Polybase
I enabled TCP/IP and made sure services were running
I then ran
USE master
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'xxxxxxxxxxxxxxxxxxx'
EXEC sp_configure #configname = 'polybase enabled', #configvalue = 1;
RECONFIGURE;
USE mydb
CREATE DATABASE SCOPED CREDENTIAL SqlServerCredentials
WITH IDENTITY = 'sa', SECRET = 'xxxxxxxx';
CREATE EXTERNAL DATA SOURCE SQLServerInstance
WITH ( LOCATION = 'sqlserver://.\sqlexpress',
PUSHDOWN = ON,
CREDENTIAL = SQLServerCredentials);
On the final CREATE EXTERNAL DATA SOURCE statement I get this error
OLE DB provider "MSOLEDBSQL" for linked server "(null)" returned message "Cannot generate SSPI context".
Msg -2146893042, Level 16, State 1, Line 0
SQL Server Network Interfaces: No credentials are available in the security package
I can't seem to figure out why I get this error

Get data from Microsoft Azure using SQL Server without using linked server

I have data stored in Microsoft Azure and want to retrieve and store into Microsoft sql server 2008 r2
without creating linked server.
Try:
Step 1: Configured Firewall settings in Azure by adding Client IP.
Step 2: Running following query from SQL Server:
EXEC sp_configure 'show advanced options', 1
RECONFIGURE
GO
EXEC sp_configure 'ad hoc distributed queries', 1
RECONFIGURE
GO
SELECT *
FROM OPENROWSET('MSDASQL', 'Driver={SQL SERVER}; Server=server.database.windows.net;Database=DBName;UID=Admin; PWD=********;', 'select * from tablename')
Note: The above steps works fine but after sometime getting following error:
Cannot initialize the data source object of OLE DB provider "MSDASQL"
for linked server "(null)".
The "SQL Server" ODBC driver that ships with Windows is deprecated and cannot be used with Azure SQL Database. It's generally best to use OLE DB with linked servers instead of ODBC when possible.
Below is and example using a SQL Server Native Client OLE DB driver:
SELECT *
FROM OPENROWSET('SQLNCLI', 'Server=server.database.windows.net;Database=DBName;UID=Admin;PWD=********, 'select * from tablename;')

Issues connecting from SQL Server to MS Access database

Environment: Windows Server 2016, SQL Server 2016; MS Access .accdb files (various versions)
Attempting to establish a linked server via oledb to an .accdb file content like this:
EXEC master.dbo.sp_addlinkedserver
#server = N'redacted',
#srvproduct = N'',
#provider = N'Microsoft.ACE.OLEDB.16.0',
#datasrc = N'D:\AccessTest\redacted.accdb',
#provstr = N'Jet OLEDB:Database Password=redacted;'
This causes an error:
The OLE DB provider "Microsoft.ACE.OLEDB.16.0" for linked server "redacted" reported an error. The provider reported an unexpected catastrophic failure. (Microsoft SQL Server, Error: 7399)
Attempted fixes:
Varying provider strings, like 'Uid=;Pwd='
Check AccessDB engine is installed (64bit)
Moved db to local drive (from network)
OLE provider set 'Allow Inprocess' to true
The database appears to be accessible through MS Access front end. No signs of corruption.
Any ideas?

Linked Server SQL Server 2014 to SQL Server Version 8

I have recently installed SQL Server 2014 Express and need to create a linked server. I have tried this in SQL Server Management Studio (from the object explorer - server objects - linked servers - add linked server).
When connecting to the server directly through Server type "SQL server" or by specifying the connection attributes in "Other data source" then Microsoft OLE DB Provider for SQL Server and filling in the additional details I receive the following error.
The linked server has been created but failed a connection test. SQL
Server native client 11.0 does not support connections to SQL Server
2000 or earlier versions.
I need to be able to create a joined query between two databases on different servers, what is the best way of achieving this ? The database I need to connect to is Version 8 (SQL Server 2000), very old. I have read it might be possible to achieve through transact SQL but not sure what steps to take.
It is possible to create a linked server but it cannot be done through the GUI. As a workaround you can create a DSN to use in transact SQL to link the servers.
For full instructions visit http://sqlwithmanoj.com/2012/12/10/sql-server-2012-does-not-support-linked-server-to-sql-server-2000-workaround/
=> WORKAROUND / FIX:
Now as a workaround to make this Linked Server work we have an option to use the ODBC Data Source which will connect to our remote server.
There are 2 approaches:
1. Either we create an ODBC Data Source (DSN) and use it in our Linked Server
2. Or, use the Data Source (DSN) connection string directly in the Linker Server Provider
–> Using appraoch #1:
Create an ODBC Data Source:
– Open Control Panel, go to Administrative Tools, then “Data Sources (ODBC)”.
– On “ODBC Data Source Administrator” window go to “System DSN” Tab.
– Here click on Add to create a new DSN.
– Choose “SQL Server” and click Finish.
– On the new window, give a proper name for the Source DSN (like: NorthWind2000DSN), we will use this name while creating our Linked Server. Provide the Server name which is on SQL Server 2000, here “NorthWind”. Click Next.
– Choose the Authentication Type, either Windows or SQL Server auth. Click Next.
– Change the default database, not necessary. Click Next.
– Click Finish. You will see a new DSN created under System DSN tab.
Now, create Linked Server and provide this DSN in the #datasrc param and provide the #provider param “MSDASQL”.
You can use the below query to create the same:
USE master
GO
-- Drop Existing LinkedServer [NorthWind2000]:
EXEC sp_dropserver #server=N'NorthWind2000', #droplogins='droplogins'
GO
-- Re-create LinkedServer [NorthWind2000] by using the ODBC connection:
EXEC sp_addlinkedserver #server = N'NorthWind2000',
#srvproduct=N'MSDASQL',
#provider=N'MSDASQL',
#datasrc = N'NorthWind2000DSN',
#location=N'System';
EXEC sp_addlinkedsrvlogin #rmtsrvname=N'NorthWind2000',
#useself=N'True',
#locallogin=NULL,
#rmtuser=NULL,
#rmtpassword=NULL
GO
–> Using appraoch #2:
We can also directly put the DSN connection String in the Provider String #provstr param.
Let’s check it below:
USE master
GO
-- Drop Existing LinkedServer [NorthWind2000]:
EXEC sp_dropserver #server=N'NorthWind2000', #droplogins='droplogins'
GO
-- Re-create LinkedServer [NorthWind2000] by using the ODBC connection:
EXEC sp_addlinkedserver #server = N'NorthWind2000',
#srvproduct=N'',
#provider=N'MSDASQL',
#provstr=N'DRIVER={SQLServer};SERVER=NorthWind;Trusted_Connection=yes;'
EXEC sp_addlinkedsrvlogin #rmtsrvname=N'NorthWind2000',
#useself=N'True',
#locallogin=NULL,
#rmtuser=NULL,
#rmtpassword=NULL
GO

Connect a protected access database to sql server

I Have a password-protected access database (.mdb) and sql server 2008 running in windows server 2008 R2 x64.
I installed "Microsost Access Database Engine" and I want to create a linked server to access, but I get this error:
"Cannot start your application. The workgroup information file is missing or opened exclusively by another user".
there is not any *.mdw file on my server.
I'm able to add a linked server to an unprotected database, but not to a protected database.
How can I add a mdw file without install MS access?
or is there any oher way to add a linked server?
USE THIS:
EXEC master.dbo.sp_addlinkedserver #server = N'Access', #srvproduct=N'Access', #provider=N'Microsoft.Jet.OLEDB.4.0',
#datasrc=N'C:\Program Files\ZKTime5.0\att2000.mdb'
EXEC master.dbo.sp_addlinkedsrvlogin #rmtsrvname=N'Access',#useself=N'False',#locallogin=NULL,#rmtuser=N'Admin',#rmtpassword=''
this works for me.
I am okay with the SQL script for creating linked servers:
////////////////Create linked server with no password access file
EXEC master.dbo.sp_addlinkedserver #server = N'linkedserver', #srvproduct=N'Smarthr', #provider=N'Microsoft.ACE.OLEDB.12.0', #datasrc=N'dbpath\file.mdb'
EXEC master.dbo.sp_addlinkedsrvlogin #rmtsrvname=N'LINKEDSVR',#useself=N'False',#locallogin=NULL,#rmtuser=NULL,#rmtpassword=NULL
//////////////////////////Create linked server with access password file
exec sp_addlinkedserver
#server = 'LinkServer',
#provider = 'Microsoft.ACE.OLEDB.12.0',
#srvproduct = 'Access4',
#datasrc = 'dbpath\filename.mdb',
#provstr = ';PWD=yourpassword'
exec sp_addlinkedsrvlogin
#rmtsrvname = 'LinkServer',
#useself = 'FALSE',
#locallogin = null,
#rmtuser = 'Admin',
#rmtpassword = null

Resources