Ver Mensaje Individual
  #17  
Antiguo 18-08-2013
Avatar de radenf
radenf radenf is offline
Miembro
 
Registrado: oct 2007
Ubicación: Viña del Mar,Chile
Posts: 608
Reputación: 19
radenf Va por buen camino
Funcionó perfecto.
Modifiqué las llamadas para poder sobreescribir la tabla y que no me arrojara excepciones por duplicar índices.

Para guardar el archivo:

Código Delphi [-]
procedure TFormConfiguracion.bsSkinButton1Click(Sender: TObject);
var
SpecialFolder: integer;
begin
SpecialFolder := CSIDL_PERSONAL;
Label5.Caption := GetSpecialFolderPath(SpecialFolder) ;
SaveDialog1.InitialDir:= Label5.Caption;
SaveDialog1.FileName:= 'Servidores Dicom';
if SaveDialog1.Execute then
ExportToText(SaveDialog1.FileName, DataSourceServidores.DataSet);
end;

y para cargar el archivo:

Código Delphi [-]
procedure TFormConfiguracion.bsSkinButton3Click(Sender: TObject);
begin
if OpenDialog1.Execute then
try
Data1.TablaServidores.Edit;
ADOQuery3.Close;
ADOQuery3.SQL.Text:= ' Delete * from Servidores ';
ADOQuery3.ExecSQL;
finally
ImportFromText(OpenDialog1.FileName, DataSourceServidores.DataSet);
Data1.TablaServidores.Close;
Data1.TablaServidores.Open;
Data1.TablaServidores.Refresh;
DBAdvGrid3.Update;
end;
end;

Me arroja sin embargo el siguiente warning y no entiendo por qué.
[DCC Warning] Configuracion.pas(674): W1036 Variable 'TS2' might not have been initialized

Saludos Daniel y muchas gracias
Responder Con Cita