Erro: Operação de várias etapas gerou erro

Delphi

16/02/2008

Olá pessoal, sou novato aqui no forum!
Gostaria de saber a opnião de vcs, sobre um erro que esta dando!
Tenho uma formulario, neste formulario tem um grid, no evento onCellClick do grid tem o seguinte codigo!

procedure TFormvisualizaragenda.DBGridmostrardataCellClick(
Column: TColumn);
begin
try
x := tela_dados_agenda.ADOQueryagenda.FieldValues [´cod´];
maskeditdataagenda.Text := FormatDateTime(´dd/mm/yyyy´,tela_dados_agenda.ADOQueryagenda.FieldValues [´data_atendimento´]);
maskedithorario.Text := FormatDateTime(´hh:mm´,tela_dados_agenda.ADOQueryagenda.FieldValues [´HORARIO´]);
comboboxsetor.KeyValue := tela_dados_agenda.ADOQueryagenda.FieldValues [´setor´];
comboboxtecnico.KeyValue := tela_dados_agenda.ADOQueryagenda.FieldValues [´tecnico´];
memoanotacaoatendimento.Text := tela_dados_agenda.ADOQueryagenda.FieldValues [´anotacoes´];
except
MessageDlg (´Aluno não possui nada agendado!´,mtInformation,[mbOk], 0);
end;
end;

Esse procedimento serve para jogar os dados da Grid para os outro campos! Mas acontece o seguinte erro.

´Operação de várias etapas gerou erro. Verifique cada valor de estatus.´ Ae logo em seguinda aponta pra seguinte linha do codigo´

-->>>maskedithorario.Text := FormatDateTime(´hh:mm´,tela_dados_agenda.ADOQueryagenda.FieldValues [´HORARIO´]);

Este é o cogido do banco de dados da seguinte tabela

CREATE TABLE ´AGENDA´
(
´COD´ INTEGER NOT NULL,
´DATA_ATENDIMENTO´ DATE NOT NULL,
´SETOR´ INTEGER,
´TECNICO´ INTEGER,
´ALUNO_MATRICULA´ INTEGER NOT NULL,
´ALUNO_PRONTUARIO´ VARCHAR(10) NOT NULL,
´ANOTACOES´ BLOB SUB_TYPE TEXT SEGMENT SIZE 80,
´HORARIO´ TIME,
CONSTRAINT ´PK_AGENDA´ PRIMARY KEY (´COD´)
);
ALTER TABLE ´AGENDA´ ADD CONSTRAINT ´FK_AGENDA_1´ FOREIGN KEY (´SETOR´) REFERENCES SETORES (´COD´) ON UPDATE CASCADE ON DELETE SET NULL;
ALTER TABLE ´AGENDA´ ADD CONSTRAINT ´FK_AGENDA_2´ FOREIGN KEY (´TECNICO´) REFERENCES TECNICOS_E_FUNCIONARIOS (´COD´) ON UPDATE CASCADE ON DELETE SET NULL;
ALTER TABLE ´AGENDA´ ADD CONSTRAINT ´FK_AGENDA_3´ FOREIGN KEY (´ALUNO_PRONTUARIO´, ´ALUNO_MATRICULA´) REFERENCES ALUNO (´PRONTUARIO´, ´MATRICULA´) ON UPDATE CASCADE ON DELETE CASCADE;
SET TERM ^ ;

Depois que ocorre esse problema, não consigo fazer o Select no Interbase.

Para inserir dados nessa tabelas, efetua-se esse procedimento abaixo.

procedure TFormagenda.BitBtnadicionaragendaClick(Sender: TObject);
begin
//procedimento do botão adicionar
try
if(labelaluno.Caption = ´´) then
begin
MessageDlg (´Selecione um aluno para adicionar na agenda!´,mtInformation,[mbOk], 0);
end
else if(comboboxsetor.Text = ´´) then
begin
MessageDlg (´Necessário preencher campo setor!´,mtInformation,[mbOk], 0);
end
else if(comboboxtecnico.Text = ´´) then
begin
MessageDlg (´Necessário preencher campo tecnico!´,mtInformation,[mbOk], 0);
end
else if (maskeditdataagenda.Text = ´ / / ´) then
begin
MessageDlg (´Necessário preencher campo Data!´,mtInformation,[mbOk], 0);
end
else if(maskedithorario.Text = ´ : ´) then
begin
MessageDlg (´Necessário preencher campo horário!´,mtInformation,[mbOk], 0);
end
else
begin
tela_dados.bancodedadosapae.BeginTrans;
tela_dados_agenda.ADOCommandinserircompromisso.Parameters.ParamValues [´data_atendimento´] := StrToDate(maskeditdataagenda.Text);
tela_dados_agenda.ADOCommandinserircompromisso.Parameters.ParamValues [´horario´] := StrToTime(maskedithorario.Text);
tela_dados_agenda.ADOCommandinserircompromisso.Parameters.ParamValues [´setor´] := comboboxsetor.KeyValue;
tela_dados_agenda.ADOCommandinserircompromisso.Parameters.ParamValues [´tecnico´] := comboboxtecnico.KeyValue;
tela_dados_agenda.ADOCommandinserircompromisso.Parameters.ParamValues [´anotacoes´] := memoanotacaoatendimento.Text;
tela_dados_agenda.ADOCommandinserircompromisso.Parameters.ParamValues [´aluno_prontuario´] := editprontuario.Text;
tela_dados_agenda.ADOCommandinserircompromisso.Parameters.ParamValues [´aluno_matricula´] := editmatricula.Text;
tela_dados_agenda.ADOCommandinserircompromisso.Execute;
tela_dados.bancodedadosapae.CommitTrans;
maskeditdataagenda.Clear;
comboboxsetor.KeyValue := Null;
memoanotacaoatendimento.Clear;
maskedithorario.Clear;
comboboxtecnico.KeyValue := Null;
maskeditdataagenda.SetFocus;
MessageDlg (´Compromisso agendado!´,mtInformation,[mbOk], 0);
end;
except
MessageDlg (´Erro, proceda a correção no(s) dado(s)!´,mtInformation,[mbOk], 0);
tela_dados.bancodedadosapae.RollbackTrans;
end;
end;

Não consigo indentificar a causa desse erro, gostaria da ajuda de vcs!!
Mto obrigado!!

Hélio!


Sanoboy

Sanoboy

Curtidas 0
POSTAR