![]() |
Crear una B.D. con paradox
Hola foristas de Delphi.
Como creo y destruyo en tiempo de ejecuccion, mediante codigo una base de datos en paradox donde le pueda agregar campos. Les agradezco la atencion que le puedan ofrecer a este mensaje, gracias |
Espero te sirva
para Crearla : Procedure Crea; FBase := TTable.Create(Self); with FBase do begin Active := False; TableType := ttParadox; TableName := 'Temporal.db' if not FBase.Exists then begin with FieldDefs do begin Clear; with AddFieldDef do begin Name := Codigo'; DataType := ftString; Size := 15; end; with AddFieldDef do begin Name := 'Descripcion'; DataType := ftString; Size := 30; end; with AddFieldDef do begin Name := 'Cantidad'; DataType := ftFloat; end; with AddFieldDef do begin Name := 'Precio'; DataType := ftFloat; end; with AddFieldDef do begin Name := 'Importe'; DataType := ftFloat; end; end; CreateTable; end; end; Y PARA DESTRUIRLA : procedure xxx.FormClose(Sender: TObject; var Action: TCloseAction); Var F : TextFile; begin inherited; if Assigned(Fbase) Then Begin AssignFile(F, FBase.Database.Directory+'\'+FBase.TableName); FBase.Close(); Erase(F); End; Action := caFree; end; |
Hola foristas; gracias a todos y especialmente a Gregory, voy a probar este codigo si me funciona si es asi se los dire por este mismo medio.
Muchas gracias |
Se puede dar este mensaje como terminado, me funciona este codigo, gracias por todo.
|
La franja horaria es GMT +2. Ahora son las 12:49:51. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi