change Colomn name automatically

  • Thread starter Diego via AccessMonster.com
  • Start date
D

Diego via AccessMonster.com

Hi
i have two different table Table1 and Table2 :

Table1 is like:
field1 field2 field3 .........fieldn
A B C N
A1 B1 C1 N1
.............................

Table2 is like this

ID_name Name .... address tel
1 pippo
2 pluto
... ...
n paperino

the goal is to change the colomn name of the first table1 with the fields of
table2 (field Name).

The results should be like
pippo pluto ......... paperino
A B N
A1 B1 N1
.....................................

Any idea ?
Thank you a lot for any suggestion
diego
 
R

Rob Parker

Hi Diego,

I don't really understand your question.

However, what I do understand is that you don't understand the basic
principles of relational database design. What you are asking involves
storing data as field names in tables - and that's completely wrong.

Read, learn, and understand the basic principles of relational database
design. You'll find lots of useful links to information at this section of
Jeff Conrad's site:
http://www.accessmvp.com/JConrad/accessjunkie/resources.html#DatabaseDesign101

HTH,

Rob
 
D

Diego via AccessMonster.com

I know.
This is a request of a potential customer that has these two tables and he
wants to do this strange thing. I do not really know if this is possible to
do this, but in any case i thank you for the support.

Best regards
Diego

Rob said:
Hi Diego,

I don't really understand your question.

However, what I do understand is that you don't understand the basic
principles of relational database design. What you are asking involves
storing data as field names in tables - and that's completely wrong.

Read, learn, and understand the basic principles of relational database
design. You'll find lots of useful links to information at this section of
Jeff Conrad's site:
http://www.accessmvp.com/JConrad/accessjunkie/resources.html#DatabaseDesign101

HTH,

Rob
Hi
i have two different table Table1 and Table2 :
[quoted text clipped - 26 lines]
Thank you a lot for any suggestion
diego
 
R

Ron2006

I know.
This is a request of a potential customer that has these two tables and he
wants to do this strange thing. I do not really know if this is possible to
do this, but in any case i thank you for the support.

Best regards
Diego





Rob said:
Hi Diego,
I don't really understand your question.
However, what I do understand is that you don't understand the basic
principles of relational database design. What you are asking involves
storing data as field names in tables - and that's completely wrong.
Read, learn, and understand the basic principles of relational database
design. You'll find lots of useful links to information at this section of
Jeff Conrad's site:
http://www.accessmvp.com/JConrad/accessjunkie/resources.html#Database...
Hi
i have two different table Table1 and Table2 :
[quoted text clipped - 26 lines]
Thank you a lot for any suggestion
diego

The real question is, are you really trying to change the field name
or are you wanting to change the label/column title that shows on the
form that is displaying the table.

The first is downright hard since every query that references the
table would have to be changed.

The second simply requires in the on load (or open ) event of what
ever forms were going to show the table to read in the second label
table and move the data to the label caption of the appropriate
fields. Messy Yes. timeconsuming - Yes.

But doable - Yes.

Ron
 
D

Diego via AccessMonster.com

The request is to create a new table (for example table3) where the field
names are read/imported from the table2 Name field.
Practically the colomn Name of table2 has a lot of records that are (should
be) the names of the new fields of the new table.
After this with a update query he can transfer the contents of table1 in the
new table3.
Best regards
Diego

I know.
This is a request of a potential customer that has these two tables and he
[quoted text clipped - 31 lines]
- Show quoted text -

The real question is, are you really trying to change the field name
or are you wanting to change the label/column title that shows on the
form that is displaying the table.

The first is downright hard since every query that references the
table would have to be changed.

The second simply requires in the on load (or open ) event of what
ever forms were going to show the table to read in the second label
table and move the data to the label caption of the appropriate
fields. Messy Yes. timeconsuming - Yes.

But doable - Yes.

Ron
 
R

Rob Parker

Hi Diego,

Since you mention a "potential customer", and also state "I know" when I
tell you that this is wrong, I assume that you are a database developer. If
this is so, then you need to learn that, particularly when it comes to
database design, the customer is not always right - in fact, the customer is
almost always wrong about how a database should be designed ;-). It's your
job, as the developer, to solve problems for the customer, not to spend lots
of pointless effort converting one incorrect database design into another
incorrect database design. The customer knows what he wants in terms of
results/outcomes - it's your job, not his, to design the database correctly
to achieve his final requirements.

It appears, from your original sample data, that the customer is wanting to
produce a table that somewhat resembles the output of a crosstab query.
What you should do is set up his table design correctly so that it can be
done that way, not set up an incorrect table design - which in all
likelihood he will want to change again in the future when he can't set up a
query to show his data in a different fashion.

Again, HTH,

Rob

Diego via AccessMonster.com said:
I know.
This is a request of a potential customer that has these two tables and he
wants to do this strange thing. I do not really know if this is possible
to
do this, but in any case i thank you for the support.

Best regards
Diego

Rob said:
Hi Diego,

I don't really understand your question.

However, what I do understand is that you don't understand the basic
principles of relational database design. What you are asking involves
storing data as field names in tables - and that's completely wrong.

Read, learn, and understand the basic principles of relational database
design. You'll find lots of useful links to information at this section
of
Jeff Conrad's site:
http://www.accessmvp.com/JConrad/accessjunkie/resources.html#DatabaseDesign101

HTH,

Rob
Hi
i have two different table Table1 and Table2 :
[quoted text clipped - 26 lines]
Thank you a lot for any suggestion
diego
 
D

Diego via AccessMonster.com

Database developer is a big word. I am a beginner respect many people that
use this forum.
Anyway you are right infact i solve the "first request" with a crosstab query,
then he ask me if it was possible to do this. My answer was, at the beginning,
that it was not possible, but after i prefered to ask to other people that
has more experience.
That is all
Thank you very much for your patience.
Happy Christmas from Italy
Diego

Rob said:
Hi Diego,

Since you mention a "potential customer", and also state "I know" when I
tell you that this is wrong, I assume that you are a database developer. If
this is so, then you need to learn that, particularly when it comes to
database design, the customer is not always right - in fact, the customer is
almost always wrong about how a database should be designed ;-). It's your
job, as the developer, to solve problems for the customer, not to spend lots
of pointless effort converting one incorrect database design into another
incorrect database design. The customer knows what he wants in terms of
results/outcomes - it's your job, not his, to design the database correctly
to achieve his final requirements.

It appears, from your original sample data, that the customer is wanting to
produce a table that somewhat resembles the output of a crosstab query.
What you should do is set up his table design correctly so that it can be
done that way, not set up an incorrect table design - which in all
likelihood he will want to change again in the future when he can't set up a
query to show his data in a different fashion.

Again, HTH,

Rob
I know.
This is a request of a potential customer that has these two tables and he
[quoted text clipped - 28 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top