Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Change database from application?

Posted on 1997-07-13
2
Medium Priority
?
161 Views
Last Modified: 2010-04-06
Is it possible to change a database field-name from within a running application?How do I do it? As an example: Say I have a database that looks like this:
Fields: Cartype   Color   Prize   Weight   Height
Posts:
        Sedan     Red     12000$   1200 Kg 1.2 m
        Truck     Gray    86000$   6500 Kg 3.2 m
        Racer     Green   45000$   800  Kg 0.85 m
Now! How do I change for example the fieldname "Prize" to "Cost" from an running application?
PS. I run Delphi Developer 2.0 and the database is a Paradox-base...
Thanks!
Erik N
0
Comment
Question by:Erik N
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Expert Comment

by:icampbe1
ID: 1338727
Do you want to change the field name just for the one run of the application, or do you want it changed permanently??
0
 
LVL 1

Accepted Solution

by:
Zonnald earned 400 total points
ID: 1338728
The field-name within the application is probably not what you want to change.  I assume that it is the label displayed on the form that is relavent to you.  Obviously you can set up some logic in the OnShow method of the form to change the field labels.

Alternatively if you are displaying the Posts using a dbGrid component then you can also use logic to change the field's 'DisplayLabel' i.e.

         tblName.fieldbyName('Prize).Displaylabel := 'Cost';

Simarily you can also control other properties of the column :

        with tblName do
        begin
            fieldbyName('Prize').Visible          := true;
            fieldbyName('Prize').Readonly     := true;
            fieldbyName('Prize').DisplayWidth := 10 ;
       end;

I hope this is useful to you.

Zonnald.




0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question