Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
pnn44794
Partner - Specialist

How do you specify a DBLINK in a database connection string?

Hello:

I have a need to be able to specify a dblink in a new connection string to a SQL Server database.  Does anyone know how to do this?  I'm attempting to connect to database A which has a dblink to database B on another server.  As always, thanks in advance for any and all responses.

1 Solution

Accepted Solutions
flipside
Partner - Specialist II

If both databases are SQL Server then it shouldn't need anything special in the connection string, you would just need to specify the database on the linked server in the SQL Select script (i.e server.database.schema.table).

Just build the connection to db A as you normally would. Database A should then handle the permissions and connection to the linked server.

flipside

View solution in original post

4 Replies
Anil_Babu_Samineni

You should connect to database A by using single connection of that DB and then same as database B with different host. Then concatenate them it will came to know whether data is coming up. I am thinking you need atleast one single common field from A & B

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
pnn44794
Partner - Specialist
Author

Hello Anil:

Thanks for the response.  I should have explained further.  The ID I'm using does not have access to Server / Database B.  That's why I want to connect to it using Server / Database A's DBLINK.  I've successfully tested that outside of Qlikview.  I don't know how to build the connection string within Qlikview and Qlikview does not appear to give you an option via the normal connection methodology, unless I'm missing something.

I'm trying to use OLE DB to connect with since it's a SQL Server database.

flipside
Partner - Specialist II

If both databases are SQL Server then it shouldn't need anything special in the connection string, you would just need to specify the database on the linked server in the SQL Select script (i.e server.database.schema.table).

Just build the connection to db A as you normally would. Database A should then handle the permissions and connection to the linked server.

flipside

pnn44794
Partner - Specialist
Author

Hello Dave:

Thanks for the reply.  Duh!!!  I had a mental block and was thinking I needed to put something in the connection string itself.  I tested your solution and it works.  Thank you very much.