Ver Mensaje Individual
  #2  
Antiguo 15-07-2003
Avatar de marcoszorrilla
marcoszorrilla marcoszorrilla is offline
Capo
 
Registrado: may 2003
Ubicación: Cantabria - España
Posts: 11.221
Reputación: 10
marcoszorrilla Va por buen camino
Porque no pruebas con este código:

Es mucho más simple creo.
Código:
procedure TForm1.Button1Click(Sender: TObject);
var
nCont:Integer;
sLista:TStringList;

begin
sLista:=TStringList.Create();
table1.FieldDefs.Update;

  for nCont:=0 to Table1.FieldDefs.Count -1 do
  begin
  sLista.Add(Table1.FieldDefs[nCont].Name);
  end;

  sLista.Sort;

  If sLista.Find('Sueldo',nCont) then
  ShowMessage('El campo ya existe.')
  else
  begin
  Table1.Close;
  Query1.Close;
  Query1.Sql.Clear;
  Query1.Sql.Add('Alter Table ''Albaranes.db'' Add Sueldo Integer');

  Query1.ExecSQL;
  end;


end;
Se necesita un Ttable y un Tquery.

Un Saludo.
Responder Con Cita