Normal Topic Is there a method to mass rename fields and elemen (Read 994 times)
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Is there a method to mass rename fields and elemen
Aug 19th, 2013 at 7:33pm
Print Post Print Post  
Is there a method to mass rename fields and elements?

I have a database (Hicfa) in an existing application that is used as a subform. I need to use that subform database in the same database (different data) but for a different purpose.

Using a backup copy of my database I first deleted the subformfield using property manager. That removed the subform database from under the main database.

Then using property manager manage fields I deleted all databases except for Hicfa

I then went to application manager and renamed my form so as not to have duplicate form names when I merged it back to the application.

I also renamed the stripped application just for safety sake.

Now I think I need to rename all my fields and elements in the remaining database to eliminate any confusion with the original Hicfa database once merged.

Is there a method of mass updating all fields and elements like adding "Hicfa2_"  to the beginning of all the fields and elements? Maybe export to XML and then use rename or something? or do I need to do it 1 field and element at a time using property manager rename feature?

Any thoughts on this?

  My goal is to get everything unique and then use merge to add it into the good application and then make it into another subform.

Thanks
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Is there a method to mass rename fields and elemen
Reply #1 - Aug 19th, 2013 at 8:03pm
Print Post Print Post  
XML export and import?
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Is there a method to mass rename fields and elemen
Reply #2 - Aug 19th, 2013 at 8:32pm
Print Post Print Post  
So basically if I rename the <data_source>!HicfaDB_B32b</data_source> and the <name>HicfaDB_B32b</name>
to
<data_source>!HicfaDB2_B32b</data_source> and the <name>HicfaDB2_B32b</name>

And then import XML I should be good?
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Is there a method to mass rename fields and elemen
Reply #3 - Aug 19th, 2013 at 9:04pm
Print Post Print Post  
If you only intend to rename the fields - yes.

Are you sure you need to do this? Field names do not have to be unique across the application. As long as they are unique within their record definition ("database"), you should be good to go.

The database name, report name, and form name, all have to be unique across the application.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Is there a method to mass rename fields and elemen
Reply #4 - Aug 19th, 2013 at 10:19pm
Print Post Print Post  
The Cow wrote on Aug 19th, 2013 at 9:04pm:
Field names do not have to be unique across the application. As long as they are unique within their record definition ("database"), you should be good to go.

The database name, report name, and form name, all have to be unique across the application.


Great information! Thanks

I was concerned that I was building in a problem with using the same field names.

It is a huge advantage to me to NOT change them, so I can use existing code from the original database where needed with minimal amount of change to Sbasic.

Thanks again for the help!

  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Is there a method to mass rename fields and elemen
Reply #5 - Aug 20th, 2013 at 12:55pm
Print Post Print Post  
Be careful and test with copies before you make any decisions. Also, if you are referring to SBasic code, that would be element names, not field names. In the XML example you provided above, you are changing a field name - a data source for an element.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged