Erro de Gravação
18/03/2003
0
OLÁ PESSOAL, ESTOU COM UMA DUVIDA, ESTOU MONTANDO UM PROG, ONDE TENHO UMA RELAÇÃO MESTRE-DETALHE, CUJO OS CAMPOS SÃO:
TABLE FORNECEDOR:
COD_FOR (CHAVE PRIMARIA)
NOME
ENDERECO
...
...
TABLE MAQUINAS:
COD_MAQ (CHAVE PRIM.)
COD_FOR (CHAVE ESTRANGEIRA)
NUM_MAQ
VALOR
O FORM ESTA MONTADO SÓ QUE NÃO CONSIGO GRAVAR AS INFORMAÇÕES.
O CÓDIGO QUE ESTOU USANDO É O SEGUINTE:
procedure TfFORNECEDORES.bokClick(Sender: TObject);
begin
TRY
groupbox3.Enabled:= true; //ONDE ESTÃO OS BOTÕES
bok.Enabled:= FALSE;
dm.cdsFornec.post;
dm.cdsMaq.post;
bfechar.Enabled:= true;
application.MessageBox(´Registro gravado com sucesso.´,´´,
mb_iconinformation);
except
dm.cdsFornec.cancel;
dm.cdsMaq.cancel;
application.MessageBox(´Erro na gravação das informações.´,
´Erro ocorrido´, mb_iconerror);
end;
end;
TABLE FORNECEDOR:
COD_FOR (CHAVE PRIMARIA)
NOME
ENDERECO
...
...
TABLE MAQUINAS:
COD_MAQ (CHAVE PRIM.)
COD_FOR (CHAVE ESTRANGEIRA)
NUM_MAQ
VALOR
O FORM ESTA MONTADO SÓ QUE NÃO CONSIGO GRAVAR AS INFORMAÇÕES.
O CÓDIGO QUE ESTOU USANDO É O SEGUINTE:
procedure TfFORNECEDORES.bokClick(Sender: TObject);
begin
TRY
groupbox3.Enabled:= true; //ONDE ESTÃO OS BOTÕES
bok.Enabled:= FALSE;
dm.cdsFornec.post;
dm.cdsMaq.post;
bfechar.Enabled:= true;
application.MessageBox(´Registro gravado com sucesso.´,´´,
mb_iconinformation);
except
dm.cdsFornec.cancel;
dm.cdsMaq.cancel;
application.MessageBox(´Erro na gravação das informações.´,
´Erro ocorrido´, mb_iconerror);
end;
end;
Rkaliman
Curtir tópico
+ 0
Responder
Clique aqui para fazer login e interagir na Comunidade :)