Ver Mensaje Individual
  #1  
Antiguo 15-05-2012
Rofocale Rofocale is offline
Miembro
 
Registrado: mar 2010
Posts: 182
Reputación: 15
Rofocale Va por buen camino
guardad datos en firebird no funciona hasta cerrar programa

Hola a todos tengo un problema que no puedo guardar los datos que agrego en mi programa hasta que se cierre el programa, osea lo añado al grid verifico con el ibexpert y aun estos datos no estan en la base de datos. cierro el programa y verifico con el ibexpert y los datos recien se guardan.

este es el codigo que uso y espero puedan ayudarme
muchisimas gracias
Código Delphi [-]
 if (sModo = 'Insertar') then
  begin
    with dmDatos.Categorias do
    begin
      Close;
      SQL.Clear;
      SQL.Add('INSERT INTO categoria (name_categ, fecha_categ, tipo, cuenta)');
      SQL.Add('VALUES(:name_categ,:fecha_categ,:tipo,:cuenta)');
      params.ParamByName('name_categ').Value := txtnombrecateg.Text;
      params.ParamByName('fecha_categ').Value := FormatDateTime('dd/mm/yyyy', Date);
      params.ParamByName('tipo').Value := sTipo;
      params.ParamByName('cuenta').Value := txtcodigo.Text;
      ExecSQL;
      Close;
    end;
      dmDatos.Tcategorias.Active := false;
  with dmDatos.categorias do
  begin
    Close;
    SQL.Clear;
    SQL.Add('SELECT * FROM categoria');
    open;
  end;
  with dmDatos.Tcategorias do
  begin
    Active := true;
  end;

  end
  else
  begin
    with dmDatos.Categorias do
    begin
      Close;
      SQL.Clear;
      SQL.Add('UPDATE categoria SET name_categ = ''' + txtnombrecateg.Text + ''',');
      SQL.Add('cuenta = ''' + txtcodigo.Text + ''',');
      SQL.Add('fecha_categ = ''' + FormatDateTime('mm/dd/yyyy', Date) + '''');
      SQL.Add('WHERE clave = ' + IntToStr(iClave));
      ExecSQL;
      Close;
    end;
  end;
Responder Con Cita