Clientdataset not in edit or insert mode
01/04/2013
0
Estou fazendo um insert e quando vou salvar apresenta o erro:
Clientdataset not in edit or insert mode:
Segue os códigos, botão insere, botão grava e botão excluir.
procedure TfrmCadPerfil.btn1Click(Sender: TObject); begin dm1.dsclientperfil.Insert; dm1.dsClientPerfil.Edit; end; procedure TfrmCadPerfil.btn2Click(Sender: TObject); begin with dm1 do begin dsClientPerfilDATACADASTRO.AsDateTime:=Now(); dsClientPerfil.ApplyUpdates(-1); dsClientPerfil.Post; end; end; procedure TfrmCadPerfil.btn3Click(Sender: TObject); begin with dm1 do begin dsClientPerfil.Edit; dsClientPerfil.Delete; dsClientPerfil.ApplyUpdates(-1); dsClientPerfil.Post; end; end;
Valdemi Ramos
Posts
01/04/2013
Rafael Cunha
procedure TfrmCadPerfil.btn1Click(Sender: TObject); begin dm1.dsclientperfil.Insert; end; procedure TfrmCadPerfil.btn2Click(Sender: TObject); begin with dm1 do begin dsClientPerfilDATACADASTRO.AsDateTime:=Now(); dsClientPerfil.Post; dsClientPerfil.ApplyUpdates(-1); end; end; procedure TfrmCadPerfil.btn3Click(Sender: TObject); begin with dm1 do begin dsClientPerfil.Delete; dsClientPerfil.ApplyUpdates(-1); end; end;
01/04/2013
Daniel Santos
01/04/2013
Valdemi Ramos
Ogb.
RESOLVIDO
01/04/2013
Valdemi Ramos
Obrigado mais uma vez!
Ao contrario do que falaram ai eu sei o que estou fazendo. Apenas troquei a linha de código por não ter costume de usar.
01/04/2013
Joel Rodrigues
Vou marcar este tópico como Concluído, para mantermos a organização do fórum.
Abraço a todos.
Clique aqui para fazer login e interagir na Comunidade :)