Linked Server from SQL Server 2012 to AIX DB2 via SSL - sql-server-2012

I need to create a linked server from SQL Server 2012 to a IBM DB2 (9.x) on AIX. It is a mandatory requirement to create the connection with SSL.
I was trying to use "Microsoft® OLEDB Provider for DB2 v4.0 for Microsoft® SQL Server® 2012" but I was not able to connect to DB2 by the Data Access Tool from MS OLEDB.
Later I installed the IBM DB2 client tools and GSKIT and with this I can connect to DB2 via SSL. With the installation also came the connection provider "IBM OLE DB Provider for DB2". The problem is that I can't create the linked server.
I always get the error message
Cannot create an instance of OLEDB Provider "IBMDADB2.DB2COPY1" for linked Sever "mydb2" (Microsoft SQL Server , Error 7302)
In some discussions was mentioned to use a specific provider string, but in this case the field of the provider string is greyed out.
I just have the options for Product name and Data Source. Is the Data Source == the DB Name of the Connection form the IBM BD2 Client tools? What should I use as Data Source?

Okay i could solve the problem and want to share the solution.
The mentioned provider IBMDADB2.DB2COPY1 comes from the installation of the IBM DB2 Client tools.
In Server Objects --> Linked Servers --> right click new server you can choose the provider. Using the "IBM OLE DB Provider for DB2 - DB2COPY1" which has access to the configured connection including the SSL Keys, the field Data Source is greyed out.
The key to successfully create a linked server to a DB2 is not the guy but the script. There you can use also provider string information even it is greyed out in the GUI.
EXEC master.dbo.sp_addlinkedserver #server = N'MyLinkedServer', #srvproduct=N'IBMDADB2',
#provider=N'IBMDADB2', #provstr= N'HOSTNAME=hosturl;Port=12345;
DATABASE=DBinDB2Client;UID=ItsMe;Pwd=secret;Security=SSL;', #datasrc=N'DBinDB2Client'
Et voila, as you can see the linked server will be created successfully and can acceess the DB2 Database. The issue is solved.
__
edit:
the linked server can only! used by it's creator. if other users want to access the server, they'll get this error:
Cannot create an instance of OLE DB provider "MSDADASQL" for linked server "MyDB2"
there is a tutorial how to give the permission to other users:
http://blogs.msdn.com/b/dataaccesstechnologies/archive/2011/09/28/troubleshooting-cannot-create-an-instance-of-ole-db-provider.aspx
after you walk through the tutorial, you also need to reboot.

Related

SSMS: Error Adding Linked Server for OracleDB

When trying to add a new Linked Server in SSMS 2019 for one of my OracleDBs hosted on a VM I receive the:
53: Login Timeout Expired if choosing the 'Microsoft OLE DB Driver for SQL Server' Provider
Or the 7302: Cannot create an instance of the OLE DB Provider if choosing the 'Oracle Provider for OLE DB' Provider.
The ODBC itself is a 64-bit connection using the: Oracle in OraClient12Home1 Driver
Which tests successfully.
If I were to go into Excel for example and choose this Data source it's able to connect to the DB without an issue and display all of my tables and pull the information down from them it's just within SSMS.
Allow In provider for both providers has also been ticked.
Any help would be appreciated!

Error when creating linked server in SQL Server 2008R2

When I create a linked server in SQL Server, it causes an error
Cannot create a instance of OLEDB provider SQLNCLI10 for linked server 'linked server name '(microsoft sql server error 7302)
How can I rectify this error?
The OLEDB provider may not properly installed. What you chose is the SQL Server native client. Do you have SSMS installed on server? This should come with sql native client OLE DB.
I would like to share an experience when I faced following error
Cannot create an instance of OLE DB provider "xxx.YYYY" for linked server "test". Error 7302.
I observed this message from a failed SQL Server job. On analysis it is found that Allow Inprocess was not enabled for the provider. When this is enabled, everything worked fine for me.
Server Objects --> Linked Servers --> Providers
Also refer following
"Cannot create an instance of OLE DB provider" error as Windows Authentication user
Linked Server Properties (Provider Options Page)
Configuring OLE DB Providers for Distributed Queries

Microsoft OLE DB Provider for SQL Server (0x80004005)

I developed a school DBMS using ASP.NET and SQL Server, and I tried to transfer to another system then I installed SQL Server 2014. After going on my through my default page inserting my user and pass all that will display is :
Unable to establish connection to database.
Error information:
Microsoft OLE DB Provider for SQL Server (0x80004005)
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
Other possible cause of this problem:
The database cannot be opened, most likely due to incorrect connection settings or insufficient security set on your database folder or file.
Can you please let know what would be issue.
Had this before, follow this guide
TLDR: Change the provider to SQLOLEDB.1
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/fab0e3bf-4adf-4f17-b9f6-7b7f9db6523c/communication-link-failure-when-connecting-to-remote-database?forum=sqlintegrationservices
SOURCE:http://stackoverflow.com/questions/6946265/ssis-package-creating-hresult-0x80004005-description-login-timeout-expired-e

Connecting to SQL Azure via Management Studio

I have a SQL Azure database. I can successfully connect to the database via the Azure management portal. In addition, I can successfully connect to the database from my application using the Entity Framework. Unfortunately, I cannot connect to the database via SQL Server Management Studio.
My thought was that SQL Server Management Studio could not connect to the 'master' database. For that reason, it would fail. So, I tried adding the database name via the "Connect to Database" field on the "Connection Properties" tab. Yet, I get the same error. The error looks like the following:
TITLE: Connect to Server
------------------------------
Cannot connect to tcp:{serverName}.database.windows.net,1433.
------------------------------
ADDITIONAL INFORMATION:
Login failed for user '{username}'.
This session has been assigned a tracing ID of '{id}'. Provide this tracing ID to customer support when you need assistance. (Microsoft SQL Server, Error: 18456)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=18456&LinkId=20476
What am I doing incorrectly here? This "server" has 2 SQL Azure databases on it that I'd like to access via management studio. How do I add users so that i can login an manage those two databases? Is there a way to even manage users on a SQL Azure database? I can't seem to figure it out.
Thank you for your help.
What version of SQL Enterprise Management Studio are you using? You need at least SQL Enterprise Management Studio 2008 R2 or later. (Might as well get the latest: http://www.microsoft.com/en-us/download/details.aspx?id=29062)
Assuming you've got that, you'd enter it like so in the Connect to Server dialog:
Server type: Database Engine
Server name: tcp:servername.database.windows.net
Authentication: SQL Server
Login: username#servername
Password: password
That should do it -- the other thing to check are the firewall restrictions. You'd be seeing a different error ("client IP address is not allowed access") but it's good to verify that, anyway.

unable to connect to sql server through vb.net

i added the bindingsource control on my winform. here are the details of my connection:
http://img43.imageshack.us/img43/3797/42119312.jpg
when i test the connection, it says "the connection cannot be tested because the specified DB file does not exist"
the DB is located in http://sql0234mjf-2.ordfsweb.com. how should i set up bindingsource?
it looks like you're trying to use a database file instead of a database server, you may need to modify your data source.
You are using the wrong provider. The "Microsoft SQL Server Database File" provider is not the SQL Server provider. Is the provider for user instances attached files (RANU). User instances are a SQL Express edition only feature and they can only be accessed locally.
To connect to a true SQL Server instance you need to use the proper provider, the Data Provider for SQL Server. When you choose this provider you are presented with a different dialog that ahs options to specify the server name and database name.