//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "capg_tabonados.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm2 *Form2;
//---------------------------------------------------------------------------
__fastcall TForm2::TForm2(TComponent* Owner)
        : TForm(Owner)
{
 TbTAbonados->Active = true;
}
//---------------------------------------------------------------------------
void __fastcall TForm2::TbTAbonadosBeforeOpen(TDataSet *DataSet)
{
 if ( !FileExists( TbTAbonados -> TableName ) )
 {
	 // Usamos la propiedad FielDefs para definir
	 // las columnas que contendrá la tabla
     TbTAbonados -> FieldDefs -> Clear();

      /********************\
     |*    Datos Básicos   *|
      \********************/
  	 TbTAbonados -> FieldDefs -> Add("idta",       ftAutoInc,  0, false );
  	 TbTAbonados -> FieldDefs -> Add("desc",       ftString,  15, false );

  	 TbTAbonados -> FieldDefs -> Add("cuota",      ftCurrency, 0, false );
  	 TbTAbonados -> FieldDefs -> Add("acceso",     ftBoolean,  0, false );
  	 TbTAbonados -> FieldDefs -> Add("faccesoAM",  ftInteger,  0, false );
  	 TbTAbonados -> FieldDefs -> Add("faccesoPM",  ftInteger,  0, false );

  	 TbTAbonados -> FieldDefs -> Add("msg",    ftString,  32, false );

     TbTAbonados -> IndexDefs-> Clear();

	 TbTAbonados->IndexDefs->Add("Primary",   "idta", TIndexOptions() << ixPrimary << ixUnique);

	 // Creamos la base...
	 TbTAbonados -> CreateTable();
 }
}
//---------------------------------------------------------------------------

