Código Delphi
[-]procedure TForm1.Button2Click(Sender: TObject);
var
Fichero: File of byte;
Buffer: array[0..21] of Char; Leidos: Integer;
Str: string;
b:byte;
i:integer;
begin
i:=0;
AssignFile(Fichero,'C:\Temp\SELE-SAL-CONSTA.tmp');
Filemode:= fmOpenRead;
Memory.Active:=true;
{$I-}
Reset(Fichero); {$I+}
Timer1.Enabled:= true;
if IOResult = 0 then
begin
while not eof(Fichero) do
begin
FillChar(Buffer,Sizeof(Buffer),0);
BlockRead(Fichero,Buffer,Sizeof(Buffer)-1,Leidos);
read(fichero,b);
if Leidos > 0 then
begin
Str:= String(PChar(@Buffer));
i:=i+1;
Label1.Caption:=inttostr(i);
CargarGrilla(Str);
end;
end;
Timer1.Enabled:=false;
CloseFile(Fichero);
end else
ShowMessage('No puedo abrir el archivo');
end;
este es el codigo, el tema que tego que actualizar mi base con este txt, como me recomiendan que la cargue o donde, my base es sqlserver.
Gracias!!