Ver Mensaje Individual
  #4  
Antiguo 31-03-2009
Avatar de edgwin
edgwin edgwin is offline
Miembro
 
Registrado: abr 2006
Ubicación: Guadalajara Jal. Mex
Posts: 163
Reputación: 19
edgwin Va por buen camino
Gracias Kipow por responder.

De hecho realizo una desconexion y una conexion a la base de datos. Lo que intento hacer es lo siguiente:

1) Realizo reestructura de la tabla.
2) Como esta tabla contiene informacion, la consulto (tambien mediante un TQuery con RequestLive = true) y edito el registro.

Pero cuando intento Editar el registro me marca un error de que el campo no existe. Pero curiosamente edito 2 campos, los cuales son nuevos. Pero solo uno de ellos me marca el error que no existe.

Código Delphi [-]

with Tabla do
begin
...
    SQL.Clear;
    SQL.Add('ALTER TABLE USUARIO ADD CODIINTE INTEGER NOT NULL');
    ExecSQL;
    Close;
...
    SQL.Clear;
    SQL.Add('ALTER TABLE MUSUA ADD CAMBPASE CHAR(1) DEFAULT ''N''');
    ExecSQL;
    Close;
...
    dm.dbase.Connected := false;
    dm.dbase.Connected := true;
    Close;
    SQL.Clear;
    SQL.Add('Select CODIINTE from MUSUA');
    Open;
    First;
    While not Eof do
    begin
       Inc(vX);
       Edit;
       FieldByName('CODIINTE').AsInteger := vX;
       FieldByName('CAMBPASE').asString := 'N'; //*******Aqui me marca el error *****
       Next;
    end;
end;
...

¿¿¿Alguna sugerencia!????
Responder Con Cita