With the help of this answer I was able to edit the data that I enter in the database, but the old data that is already registered, when I try to change the register, the program continues to close by itself and when debugging displays the following message error.
AndifIcontinuedebuggingtheerrorhappenstobe:
Ihavebeendebuggingthecodeandtheerrorisoccurringinprocedure
Send_ftp,myprocedure
lookslikethis:
procedureTfrmCriarArquivo.Envio_ftp(grupo,cliente:string);beginwithFTPdotryUsername:=frmMenu.usuario;Password:=frmMenu.senha;Host:=frmMenu.endereco;Port:=StrtoInt(frmMenu.porta);Connect;tryChangeDir(grupo);exceptFTP.MakeDir(grupo);ChangeDir(grupo);end;tryFTP.Put('dados.ini','dados.ini',false);exceptend;tryChangeDir(grupo+'/'+cliente);exceptFTP.MakeDir(grupo+'/'+cliente);ChangeDir(grupo+'/'+cliente);end;exceptapplication.Terminate;end;tryFTP.Put(cliente+'.xml',cliente+'.xml',False);FTP.Put('Tags'+'_'+cliente+'.txt','Tags'+'_'+cliente+'.txt',false);finallyFTP.Disconnect;end;DeleteFile(cliente+'.xml');DeleteFile('Tags'+'_'+cliente+'.txt');DeleteFile('dados.ini');end;
RememberingthatthisonlyhappenswhenItrytochangetheoldbankrecords.
NewError:
and how did procedure
get after the change:
with FTP do try
Username := frmMenu.usuario;
Password := frmMenu.senha;
Host := frmMenu.endereco;
Port := StrtoInt(frmMenu.porta);
Connect;
try
ChangeDir(grupo);
except
FTP.MakeDir(grupo);
ChangeDir(grupo);
end;
try
FTP.Put('dados.ini', 'dados.ini', false);
except
end;
try
ChangeDir(grupo + '/' + cliente);
except
FTP.MakeDir(grupo + '/' + cliente);
ChangeDir(grupo + '/' + cliente);
end;
except
application.Terminate;
end;