Bueno. yo lo hago así y funciona a las mil maravillas en redes punto a punto o estructuradas, sin necesidad de compartir directorios ni archivos...
en un datamodule tengo:
Código:
unit DM_Ppal1;
interface
uses
SysUtils, Classes, DB,dialogs, jpeg, DBTables,dateutils,
registry,forms,inifiles, types, IBTable,
IBDatabase,Windows, IBStoredProc, IBCustomDataSet, IBQuery;
type
TdmPpal1 = class(TDataModule)
fbArgos: TIBDatabase;
fbtraArgos: TIBTransaction;
fbtblArea: TIBTable;
fbtblVisitas: TIBTable;
fbtblVisitante: TIBTable;
fbtblUsuario: TIBTable;
fbtblEmpleado: TIBTable;
dsArea: TDataSource;
dsEmpleado: TDataSource;
dsUsuario: TDataSource;
dsVisitante: TDataSource;
dsVisitas: TDataSource;
procedure DataModuleCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
published
end;
var
dmppal1: Tdmppal1;
rutadatos,rutadatosred,rutareportes,rutareportesred,rutatempletes:string;
rutatempletesred,rutafotos,rutafotosred,ruta,rutared,empresa:string;
red:integer;
implementation
{$R *.dfm}
//------------------------------------------------------------------------------
procedure TdmPpal1.DataModuleCreate(Sender: TObject);
var
registro:TIniFile;
conexionL,conexionR:widestring;
begin
registro:=TIniFile.Create(ExtractFilePath(Application.ExeName) + 'Registro.reg');
red:=StrToInt(registro.ReadString('RED','EstaEnRed',''));
conexionL:=registro.ReadString('BASEDATOS','local','');
ruta:=registro.ReadString('DDIRBASE','dirbaseLocal','');
conexionR:=registro.ReadString('BASEDATOS','red','');
rutared:=registro.ReadString('DDIRBASE','dirbaseRed','');
rutadatos:=ruta+registro.ReadString('DDATOS','datos','');
rutadatosred:=rutared+registro.ReadString('DDATOS','datos','');
rutareportes:=ruta+registro.ReadString('DREPORTES','reportes','');
rutatempletes:=ruta+registro.ReadString('DTEMPLETES','templetes','');
rutafotos:=ruta+registro.ReadString('DFOTOS','fotos','');
rutareportesred:=rutared+registro.ReadString('DREPORTES','reportes','');
rutatempletesred:=rutared+registro.ReadString('DTEMPLETES','templetes','');
rutafotosred:=rutared+registro.ReadString('DFOTOS','fotos','');
case red of
0:fbArgos.databasename:=conexionL;
1:fbArgos.databasename:=conexionR;
end;
try
fbArgos.Connected:=true;
except
application.Terminate;
end;
fbtraArgos.Active:=true;
fbtblArea.Active:=true;
fbtblEmpleado.Active:=true;
fbtblUsuario.Active:=true;
fbtblVisitante.Active:=true;
fbtblVisitas.Active:=true;
fbviwVisNotas.Active:=true;
end;
end.
el archivo registro.reg esta así:
--------------------------------------
[RED]
EstaEnRed=0
[DDIRBASE]
dirbaseLocal=C:\Archivos de programa\IDC\ARGOS\
dirbaseRed=\\Idcppal\Argos\
[BASEDATOS]
local=C:\Archivos de programa\IDC\ARGOS\data\ARGOSFB1502.FDB
red=IDCPPAL:c:\archivos de programa\IDC\Argos\data\ARGOSFB1502.FDB
[DDATOS]
datos=data\
[DREPORTES]
reportes=reportes\
[DTEMPLETES]
templetes=data\templetes\
[DFOTOS]
fotos=data\fotos\
-----------------------------------------
el servidor tiene nombre: IDCPPAL, aunque puede ser 192.168.1.1 o cualquier dirección IP.
Saludos