Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding permanent table field at runtime

Status
Not open for further replies.

auditdi30

Programmer
Feb 25, 2009
39
NO
Hello!

Is there a way of adding a new field to a table at runtime, and make the field permanent to the table?? In all the example I found, the field is erased after closing the application.

TIA
Kåre!
 
Sorry if my posts have confused you. For some reason I thought you were trying to port data from Paradox to SQL.

Although Paradox can be accessed with some SQL statements, it is very limited and not really a SQL language.

From 'LocalSQL.hlp' file:
"Local SQL is the subset of the SQL-92 specification used to access dBASE, Paradox, and FoxPro tables. On receiving local SQL statements from front-end applications, the Borland Database Engine (BDE) translates the statements into BDE API functions." I would add "very sloooowly" compared to real SQL databases.

I've never been able to add fields programically to a Paradox table. The easiest way is to use Database Desktop to manage you Paradox tables. I have created new table progamically (cloning the old one) and added new fields (AddFieldDef) during the creation of the new one(CreateTable). Then dump the existing data from the old table to the new. There may be a way to add fields to existing Paradox tables, but I've never succeeded.

See: "AddFieldDef method (TFieldDefs)" in Delphi help. That page has an example link. But the example code includes "if not Table1.Exists then begin" which to me is a clue.

Fighting with Paradox is just not worth the effort with so many alternatives that work so much better. AND you will find much more available help.

If not yet convinced, seach this forum for Paradox.


Roo
Delphi Rules!
 
Thank's for å great answer. But what database will you recommended that I use instead of Paradox?? I am using Delphi 7
 
I'm using D7 and MySQL is also my choice. I used Paradox for a long time and now wish I had switched sooner.

Roo
Delphi Rules!
 
What is the biggest different betwheen Paradox and Mysql??

Where can I download Mysql??

Can someone give me a small delphi example with both Paradox and Mysql??

TIA
Kåre!
 
What is the biggest different betwheen Paradox and Mysql??
Read up ^.

Where can I download Mysql??

Read everything first. You should eventually end up here:

Can someone give me a small delphi example with both Paradox and Mysql??
Read up ^. The example already provided reads from Paradox and writes to MySQL.

Once you get MySQL installed and running, click here:

There is also a Tek-Tips forum dedicated to MySQL.
(Please search it before posting questions.)

Good bye and good luck.

Roo
Delphi Rules!
 
Hello..

i try tips from Lespaul and its working..(i use ms access db)
but i had a problem with type of YES/NO field. format (by general tab) in then field is empty (it should 'YES/NO') and display control (by lookup tab) is set to text box (i want its set to 'CHECK BOX').
How to solve this problem...
Thnks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top