A data dictionary cannot have files on 2 different servers. What you need to do is have a data dictionary for the files on each server. Then you create a 2nd database connection to the 2nd server and then you can access those files.
This is some code fragments. Drive G: is mapped to Server1 and drive H: is mapped to Server2. A separate ADS server is loaded on each server with its own license.
/*
This program copies the existing definition from g:\FCA\DATA to each of
the other companies
*/
#INCLUDE "AXCDXCMX.CH"
clear
oDACSession(1):SetDefault()
select 0
use fca SHARED VIA 'ADSDBE' Alias fca
select 0
use G:\aff\data\fca SHARED via 'ADSDBE' alias fcaAFF
select 0
use G:\dfs\data\fca SHARED via 'ADSDBE' alias fcaDFS
select 0
use G:\bfc\data\fca SHARED via 'ADSDBE' alias fcaBFC
oDACSession(2):SetDefault()
select 0
use H:\hg1\data\fca SHARED via 'ADSDBE' alias fcaHG1
select 0
use H:\hg2\data\fca SHARED via 'ADSDBE' alias fcaHG2
select 0
use H:\hg4\data\fca SHARED via 'ADSDBE' alias fcaHG4
select 0
use H:\afh\data\fca SHARED via 'ADSDBE' alias fcaafh
This is the modified dbesys that establishes 2 connections one to drive g: (server1) and one to drive h: (server2) The connection is only important when opening the file, they you access via the alias. You much close both connections also.
dbesys.prg (modified for 2 data connections.
// Xbase++ DatabaseEngine startup/preloader
//
// Syntax:
// DbeSys() is called automatically at program start before the
// function MAIN.
//
//////////////////////////////////////////////////////////////////////
#include "ads.ch"
#include "adsdbe.ch"
#define MSG_DBE_NOT_LOADED " database engine not loaded"
#define MSG_DBE_NOT_CREATED " database engine could not be created"
STATIC oDACSession1
STATIC oDACSession2
*******************************************************************************
* DbeSys() is always executed at program startup
*******************************************************************************
PROCEDURE dbeSys()
//
// The lHidden parameter is set to .T. for all database engines
// which will be combined to a new abstract database engine.
//
LOCAL aDbes := { { "DBFDBE", .T.},;
{ "NTXDBE", .T.},;
{ "CDXDBE", .T.},;
{ "DELDBE", .F.},;
{ "SDFDBE", .F.},;
{ "ADSDBE", .F.} }
LOCAL aBuild :={ { "DBFNTX", 1, 2 },;
{ "DBFCDX", 1, 3} }
LOCAL i
LOCAL cSession
LOCAL oThread
//
// Set the sorting order and the date format
//
SET COLLATION TO AMERICAN // changed for ADS
SET DATE TO AMERICAN
//
// load all database engines
//
FOR i:= 1 TO len(aDbes)
IF ! DbeLoad( aDbes[1], aDbes[2])
Alert( aDbes[1] + MSG_DBE_NOT_LOADED , {"OK"} )
ENDIF
NEXT i
//
// create database engines
//
FOR i:= 1 TO len(aBuild)
IF ! DbeBuild( aBuild[1], aDbes[aBuild[2]][1], aDbes[aBuild[3]][1])
Alert( aBuild[1] + MSG_DBE_NOT_CREATED , {"OK"} )
ENDIF
NEXT i
cServer := 'G:'
cServer := Upper(cServer)
cSession := "DBE=ADSDBE;SERVER=" + cServer
oDACSession1 := DacSession():new(cSession)
IF !oDACSession1:isConnected()
Alert( "Unable to establish connection to ADS Server" + ';' + ;
"Error Code: " + Alltrim(Str(oDACSession1:getLastError())) + ';' + ;
oDACSession1:getLastMessage() + ";" + "Using DBFCDX Driver", {"OK"} )
ELSE
dbeSetDefault('ADSDBE')
DbeInfo( COMPONENT_DATA, ADSDBE_MEMOBLOCKSIZE, 64 )
DbeInfo( COMPONENT_DATA, ADSDBE_TBL_MODE, ADSDBE_CDX )
DbeInfo( COMPONENT_ORDER, ADSDBE_TBL_MODE, ADSDBE_CDX )
DbeInfo( COMPONENT_DATA, ADSDBE_LOCK_MODE, ADSDBE_PROPRIETARY_LOCKING )
ENDIF
cServer := 'H:'
cServer := Upper(cServer)
cSession := "DBE=ADSDBE;SERVER=" + cServer
oDACSession2 := DacSession():new(cSession)
IF !oDACSession2:isConnected()
Alert( "Unable to establish connection to ADS Server" + ';' + ;
"Error Code: " + Alltrim(Str(oDACSession2:getLastError())) + ';' + ;
oDACSession2:getLastMessage() + ";" + "Using DBFCDX Driver", {"OK"} )
ELSE
dbeSetDefault('ADSDBE')
DbeInfo( COMPONENT_DATA, ADSDBE_MEMOBLOCKSIZE, 64 )
DbeInfo( COMPONENT_DATA, ADSDBE_TBL_MODE, ADSDBE_CDX )
DbeInfo( COMPONENT_ORDER, ADSDBE_TBL_MODE, ADSDBE_CDX )
DbeInfo( COMPONENT_DATA, ADSDBE_LOCK_MODE, ADSDBE_PROPRIETARY_LOCKING )
ENDIF
AX_AXSLocking( .T. ) // Set AXS locking to non clipper compatible
AX_RightsCheck( .T. ) // Turn off networks right checking // chg 10/1
// AX_RIGHTSCHECK(.T.) // CHANGED FOR ADS TESTING
// changed above for testing
// AX_ChooseOrdBagExt( 'CDX') //
RETURN
FUNCTION oDACSession(nNum)
IF nNum = 1
RETURN oDACSession1
ENDIF
RETURN oDACSession2
//
// EOF