Ver Mensaje Individual
  #3  
Antiguo 25-04-2013
feliz-58 feliz-58 is offline
Miembro
 
Registrado: sep 2012
Posts: 314
Reputación: 12
feliz-58 Va por buen camino
Cita:
Empezado por ecfisa Ver Mensaje
Hola feliz-58.

Código Delphi [-]
procedure TForm1.DeleteTable(const TableName: string);
const
   MSG = '¡Atención! se borrará la tabla %s ¿ Continua ?';
begin
  if MessageBox(Handle, PChar(Format(MSG,[TableName])), '', MB_ICONWARNING+MB_YESNO) = IDYES then
    with ADOQuery1 do
    begin
      Close;
      SQL.Text := 'DROP TABLE ' + TableName;
      ExecSQL;
    end;
end;

Llamada ejemplo:
Código Delphi [-]
  if ComboBox1.ItemIndex > -1 then
    DeleteTable(ComboBox1.Items[ComboBox1.ItemIndex]);

Saludos.
Donde voy a Poner el Codigo base?
Responder Con Cita