Criação de Tabelas em tempo de execução

Delphi

26/11/2003

Preciso de duas funções :
1 - Testar e se não existir criar em tempo de execução uma tabela em DBASE III.
2 - Testar e se não existir criar em tempo de execução índices para tabelas em DBASE III.


Rcosti

Rcosti

Curtidas 0

Respostas

P_lima

P_lima

26/11/2003

Tente isso.
/////////


With TableTempo Do
Begin

Active := False;
DataBaseName := ´C:\UNIDADE´;
TableName := ´TABELA.DBF´;
TableType := ttDbase;

With FieldDefs Do
Begin
Clear;
Add(´PEDIDO´, ftInteger, 00, False);
Add(´NOME´, ftString, 40, False);
Add(´COD_CLI´,ftInteger, 00, False);
Add(´VENCI´, ftDate, 00, False);
Add(´VALOR´, ftCurrency,00, False);
Add(´DATA´, ftDate, 00, False);
Add(´HORA´, ftString, 08, False);
End;

CreateTable;

Active := True;

AddIndex(´PEDIDO´,´PEDIDO´,[]);
AddIndex(´NOME´,´NOME´,[]);

End;
End;
End;


GOSTEI 0
POSTAR