![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#12
|
|||
|
|||
|
Hola, de nuevo, ahora me salta un error ,acá pongo el codigo para que vean:
Código Delphi [-]procedure TFormGrupos.BitBtn1Click(Sender: TObject); //Agrega un Grupo sino está en la Tabla TGrupos. Var agregar:String; CO:Integer; begin //Primero Buscar el Registro para ver si está . Y verifica tambien el codigo FormGrupos.ADOQuery1.Active := False; FormGrupos.ADOQuery1.SQL.Text := 'Select Nombre From TGrupos WHERE Nombre = :Nombre'; FormGrupos.ADOQuery1.Parameters.Parambyname('Nombre').Value:= Edit1.Text; FormGrupos.ADOQuery1.Active := True; If Edit1.Text = FormGrupos.ADOQuery1.Fields[0].Value then begin MessageDlg('El Grupo : '+Edit1.Text+' ya Existe ',mtError,[mbOK],0); Edit1.text:=''; Edit1.SetFocus; end else begin //Ahora me fijo el Código si ya existe. //FormGrupos.ADOQuery1.SQL.Clear; FormGrupos.ADOQuery1.Active := False; FormGrupos.ADOQuery1.SQL.Text:= 'Select Cod_G TGrupos From TGrupos Where Cod_G = :Cod_G'; FormGrupos.ADOQuery1.Parameters.Parambyname('Cod_G').Value:= StrToInt(Edit2.Text); FormGrupos.ADOQuery1.Active:=true; If (StrToInt(Edit2.Text)) = FormGrupos.ADOQuery1.Fields[0].Value Then begin MessageDlg('El Código: '+Edit2.Text+', ya existe', mtError,[mbOk],0); Edit2.Text:=''; Edit2.SetFocus; end else //Esta todo bien entonces agrego. begin FormGrupos.ADOQuery1.Active := False; FormGrupos.ADOQuery1.SQL.Text:= 'Insert Into TGrupos (Nombre, Cod_G) Values (:Nombre, :Codigo)'; FormGrupos.ADOQuery1.Parameters.Parambyname('Nombre').Value:= Edit1.Text; FormGrupos.ADOQuery1.Parameters.Parambyname('Codigo').Value:= StrToInt(Edit2.Text); FormGrupos.ADOQuery1.ExecSQL; end; end; y lo que esta en verde ,me tira error :"Error de sintaxis (falta operador) en la expresion de cunsulta Cod_G TGrupos" |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Cuál es la Mejor forma de Eliminar Conexiones Clientes de un Server Indy | R_Richards | Internet | 4 | 22-07-2010 15:11:09 |
| Eliminar Codigo Cual es la mejor Forma ? | sierraja | Varios | 1 | 12-04-2007 00:41:00 |
| cual es la mejor forma de logearse a mysql... | Arturo | MySQL | 1 | 11-10-2006 17:45:01 |
| Cual es la mejor forma de coneccion con sql server 2000 | alexander66 | MS SQL Server | 3 | 21-07-2006 09:59:58 |
| cual es la mejor forma ? | martita | Varios | 14 | 07-07-2005 19:35:55 |
|