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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find if a field is used or not

Status
Not open for further replies.

Bennie47250

Programmer
Nov 8, 2001
515
US
Using Crystal 7.0 SQL 2000 Database

Inside this database is a Table named Sales_Information, one of the 50+ fields is named ProductFamilyKey. Due to some other programming the values in this field no longer means the same thing. For example 1 used to indicate Apple, now 1 indicates Cow.

I need to find any report that uses this field so I can make the appropriate changes to the reports. Is there an easy way to do this?

What I have done is changed the field name to ProductFamilyKey_A in the table thinking if any report used it, it would blow up and I could correct it as this occurs however I would like to be more proactive than reactive.

Thanks
 
Bennie47250,

Export each report in turn to "report definition file" format. You will get a text file that contain, among many other items, the names of all the fields used in the reports.

Next, open those text files in a word processor or editor, and search for the field name in question. If you are using Word for this, you could write a macro to do the searching.,

Going one step further, I have written a little program which scans the report definition files, extracts all the field and table names, and stores them in a new table. You are welcome to have a copy of the program if it would help. It is written in Visual Foxpro, but can probably be translated to other languages if necessary. You can grab a copy from
Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
You might just compile the VFP code and offer that, Mike, should be useful to some.

-k
 
synapsevampire,

<< You might just compile the VFP code and offer that >>

I considered that. The problem is that VFP requires a run-time library which is about 15 MB. Plus you need to run a Windows Installer-type setup. I wondered if that might be bit too much trouble for most folk.

Mike



Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Mike, Nice web site.

Thanks for the suggestion. I had done this for a few of the reports I suspected that may use this field. I was hoping there was an easier/quicker way to check all of the 50-75 report that use the database. I guess I'll be reactive on this one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top