Add an existing OleDB provider to SQL Server - sql-server

I am trying to get SQL to leverage an OleDb provider that's already installed on the machine (PHDOledb.dll).
I'm able to leverage the provider in c# using the OleDbConnection object, using a connection string like this one:
Provider=PHDOleDB;Data Source=SERVERNAME;Extended Properties="PORT=12345";Initial Catalog=StandardAPI;Password=""
SQL Server does not (automatically) recognize the provider. I can pull up a list of providers using the following SQL Command, but the provider is not listed:
EXEC sys.sp_enum_oledb_providers
For the life of me, I cannot find any information on how to add/register an existing oledb driver to SQL server, everything I have found is related to either the MS SQL Oledb provider, or IBM, or Oracle, or trouble-shooting issues like 'provider is not registered" etc.
The provider is there.... I just can't get SQL to recognize it...
Please help!

Related

ADO.NET connection fails for a SSIS Execute SQL task once it is deployed to a SQL Server instance

I am working on my first SSIS package that is pulling data from one on-premise SQL Server instance doing some transformations and writing it to a separate on-premise SQL Server instance.
While working with the package in my SSDT project all of my tasks run and work correctly.
Once I deploy the package to SQL Server the ADO.NET connection to the source database fails.
The package is deployed on the destination SQL Server instance.
There is a data flow task earlier in the package that uses an OLE DB connection which is successful and uses the same SQL Authentication username and password combination.
I get the error:
Read Group Membership:Error: Failed to acquire connection "sourcedb.testtable". Connection may not be configured correctly or you may not have the right permissions on this connection.
One thought is that I may need to configure an ADO.NET connection provider on the source database.
As this is my first foray into SSIS I expect the fix is trivial, I just can't get there.
Update with solution:
I resolved the issue by using an OLE DB connection rather than the ADO.NET. I didn't realize I could still sue the results from an OLE DB connected query to populate an ADO Enumerator.
Changed to use an OLE DB connection rather than an ADO.NET connection.
I had thought I needed an ADO.NET connection to populate my data and use it in a foreach as an ADO Enumerator.

Can connect to data source in DAO but not in ADO using the same connection string

I am experimenting with executing SQL Server stored procedures on a SQL Server back end from Access via DAO / ADO.
I can get it working quite well in DAO by using a pass-through query with a connection string to an ODBC data source
When I try to use the same connection string on an ADO Connection object however, I just get the message:
Error -2147467259: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (Microsoft OLE DB Provider for ODBC Drivers)
The connection string that worked with DAO was a pointer to a DSN file: "ODBC;FILEDSN=RISCGen2.dsn".
Thinking that ADO might not be able to digest this, I tried replacing the string with the relevant content from the DSN file, namely:
“ODBC;DRIVER={ODBC Driver 11 for SQL Server};UID=my.loginid;PWD=mypassword;SERVER=WYNRISC08;Database=RISCGen2”.
However, I am still getting the same error.
Can someone spot where I am going wrong with this? Thanks in advance.
ADDENDUM
Dan Guzman has answered the question I posed. The problem has now become one of understanding certain messy details about ADO's way of doing things. I am thinking I will need to ask another question to deal with it...New question posted : Execute SQL stored procedure from VBA and retrieve all messages and result sets
ODBC;DRIVER={ODBC Driver 11 for SQL
Server};UID=my.loginid;PWD=mypassword;SERVER=WYNRISC08;Database=RISCGen2
Omit the extraneous ODBC specification:
DRIVER={ODBC Driver 11 for SQL Server};UID=my.loginid;PWD=mypassword;SERVER=WYNRISC08;Database=RISCGen2
Note that classic ADO is natively OLE DB and uses the Microsoft OLE DB Provider for ODBC Drivers (MSDASQL) to use ODBC drivers. It would be best to use an OLE DB provider instead. You could use the legacy SQL Server OLE DB provider that ships with Windows (SQLOLEDB) but it would be best to use the latest MSOLEDBSQL driver as of this writing. The connection string for that is:
Provider=MSOLEDBSQL;UID=my.loginid;PWD=mypassword;SERVER=WYNRISC08;Database=RISCGen2
You might need to specify DataTypeCompatibility=80 if you use newer SQL data types because ADO classic is a mature API that hasn't been enhanced since SQL Server 2000 and is unaware the data types added since.

SSIS Active Directory Integrated

I am running some SSIS packages locally that need to insert data into an Azure v12 SQL Database. For authentication we would like to use "Active Directory Integrated". This works if I connect via SQL Management Studio so it is setup right. However my SSIS package is giving me an error of
My connection string looks like this
So note the authentication param which I think is causing the issue.
Any ideas onusing this type of security with SSIS? The SSIS package is being run from a SQL 2016 server.
SSIS OLE DB connections does not support Azure integrated security yet, and it's very undocumented. You have to workaround by creating an SQL login with password Or use ADO.NET connection
If you have an OLEDB connection using SQLNativeClient, you can make a change to allow the use of Active Directory. First download Microsoft® OLE DB Driver 18 for SQL Server®
https://www.microsoft.com/en-us/download/details.aspx?id=56730
Then view the SSIS package in code and change the connection string to 'Provider=MSOLEDBSQL;Authentication=ActiveDirectoryIntegrated;Encrypt=yes'
The UI will not display the AD options, but it will work for an Execute SQL Task, not yet managed to get it to work for and OLE DB source.
I also managed to get this working for an OLE DB data source by setting the DelayValidation True on the Data Flow.

Pulling data from Azure SQL database into an Excel through a parameterised stored procedure

I have data in an Azure SQL database, which I would like to pull into an Excel sheet through the use of stored procedure(s) which require parameters.
However, I'm struggling to do this, as I cannot get it to work how it works with a local SQL server. Ordinarily this is done through Microsoft Query, defining the connection to the database, and entering { CALL sproc (?) } and then using the Connections command to map a cell to the parameter.
I cannot set up a connection to the database in MS Query. When I enter the xxx.database.windows.net as the server, my username / password, and then try to switch to database I need to use I get the message below
Filling listbox failed:
SQLState: '37000'
SQL Server Error: 40511
[Microsoft][ODBC SQL Server Driver][SQL Server]Built-in function 'has_dbaccess' is not supported in this version of SQL Server.
Can anyone offer any assistance please?
Create a text file with the .DSN extension then add content like the following into it...
[ODBC]
DRIVER=SQL Server
SERVER=xxxxxxxx.database.windows.net,1234
APP=Microsoft Office 2010
WSID=NA
DATABASE=DB12345
[Microsoft Office]
UID=myUsername
PWD=myPassword
You can then just use this connection from Microsoft Query without dealing with the dialogs that are giving you grief.
I just figured this out with a combination of Youtube videos and dumb luck lol. You have to create an OBDC connection with Microsoft ODBC Driver 13.1 for SQL Server (or higher.) Make sure you connect and define the correct database in the ODBC object while entering in your Azure SQL connection info. Once that's done from within excel you can use MS Query to select that ODBC object and pull the data as you normally would.

How do I register IBM.Data.DB2.iSeries as a linked server provider in SQLServer?

I have connected to a DB2 database on our AS400 through SQL Server 2005 (linked server) using the IBMDA400 (OLEDB) provider. However, I recently discovered that I can connect my .Net apps using the IBM.Data.DB2.iSeries.dll provider so I would like to connect to the AS400 using my IBM.Data.DB2.iSeries provider instead. However, the IBM.Data.DB2.iSeries provider is not in my list of options to connect with when trying to set up my linked server. How do I register this as a provider?
What is wrong with your OLE DB provider ? Why do you want to use .NET provider?
As far as I know a linked server requires an OLE DB provider to work with iSeries DB2 database and there is no option to use .NET instead. IBM.Data.DB2.iSeries provider allows .NET managed programs to access the iSeries database files using SQL.
Have a look on this:
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=/rzaik/rzaikdotnetprovider.htm
You can try to install IBM iSeries Access for Windows and Programmer's Toolkik after that, but I would be surprise if you can see DB2 iSeries .NET provider on the provider list in SQL Server.
Do you have any performance issues or something doesn't work with OLE DB?

Resources