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!

Fielddefs

Status
Not open for further replies.

auditdi30

Programmer
Feb 25, 2009
39
NO
Hello!

I am using paradox tables, and Delphi 7.

1. is it possible to change the fieldnumber in fielddefs?? Etc. if I make a table with 3 fields; name, adr, and pos. And later want to change it to name, post and adr. How to do that by code?

2. Is it also possible to delete a field in a table, by code?? If so, how??

Know that both this questions can be solved in Database Desktop, but want to do it by code!

TIA
Kåre!
 
This may not answer your question the way you want, but unless you are specifically wanting to modify (alter) the actual Paradox table file, you can control in software both at design time and run time the *displayed* relative position of the fields without affecting the actual relative position of the fields in the actual Paradox tables.

For example:
SELECT name, adr, post FROM table_name;
SELECT name, post, adr FROM table_name;

The TDBGrid (should you use it) will show the order of the fields as they appear the in SELECT statement.

Steve.
 
yes you can delete a field in code (actually running a SQL command):

Code:
ALTER TABLE tableName DROP COLUMN fieldName

Leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top