Results 1 to 2 of 2
  1. #1
    Join Date
    May 2004
    Posts
    9

    Unanswered: Linking different databases through SQL

    Hi.

    I'd like to link a dBase4 database with a Microsoft database using SQL. Is this possible? The difficulty lies in the connectionstring to the database. I don't know how to link to two different location.
    Is this only possible by combining two recordsets?

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    In microsoft SQL server you can create a linked server using the sp_addlinkedserver stored procedure. I am not sure what the correct arguments are for dbase4 but you can Google those or maybe look them up in BOL. Then you can just use your connection string to the SQL Server.

    When you query the linked server you have to use OPENQUERY.

    SELECT * FROM OPENQUERY(linkedservername,'SELECT * FROM ORDERS')
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •