KALUNGA Posted June 30, 2011 Report Share Posted June 30, 2011 procedure TForm4.BtnInserirVacinaClick(Sender: TObject);begin if ADOConnection1.Connected = True then begin ADOQuery1.SQL.Clear(); ADOQuery1.SQL.Add('Insert Into Vacinas (cod_vacina, descr_vacina, '+ ' cod_fornecedor)values ('+EdCodVacinas.Text+', '+ ' '+QuotedStr(EdDescrVacina.Text)+', '+ ' '+CodiFornecedor.Text+')'); ADOQuery1.ExecSQL; ShowMessage('Dados inseridos com sucesso!'); end else ShowMessage('Favor conectar no banco de dados');end; Quote Link to comment Share on other sites More sharing options...
0 Jhonas Posted June 30, 2011 Report Share Posted June 30, 2011 Faça uma pesquisa no forum pela palvra updateou então vejahttp://www.w3schools.com/SQl/sql_update.aspabraço Quote Link to comment Share on other sites More sharing options...
0 Progr'amador Posted July 1, 2011 Report Share Posted July 1, 2011 Olá,você quer fazer um Update mesmo, ou quer fazer funcionar esse Insert que você postou?Abs. Progr'amador Quote Link to comment Share on other sites More sharing options...
Question
KALUNGA
procedure TForm4.BtnInserirVacinaClick(Sender: TObject);
begin
if ADOConnection1.Connected = True then
begin
ADOQuery1.SQL.Clear();
ADOQuery1.SQL.Add('Insert Into Vacinas (cod_vacina, descr_vacina, '+
' cod_fornecedor)values ('+EdCodVacinas.Text+', '+
' '+QuotedStr(EdDescrVacina.Text)+', '+
' '+CodiFornecedor.Text+')');
ADOQuery1.ExecSQL;
ShowMessage('Dados inseridos com sucesso!');
end else
ShowMessage('Favor conectar no banco de dados');
end;
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.