Hi, I need help.
I have 192 databases that I need to redact certain information in certain columns. Generally, I'm looking for field names like name, first name, last name, address, address2, shipping address, mailing address, and phone numbers. Not sure how to get this information without going into every database and every local table inside the databases. Is there a way to get this information programmatically and just access the databases and table that I need to redact info in?
This can be done. I have done this is the past. The general approach was as follows:
1-get a list of all databases (in my case it was .mdb) on a per drive basis C: D: E: (I used a dos command IIRC) to specific files
I just tried this with DOS command
Code:
DIR C:\*.mdb /o/s/w >C:\Temp\AllMDBonC.txt
see attached info for output
You will need a program to read and parse the directories and related .mdb names
2-create a database with a table to record
- drive, path, db name, date of run
3-populate the database with the info from 1 (import as csv)
4-I have a routine that gets field names and description etc from tables in a database (deletes old version, creates new and parses to get names, descriptions(if they exist), ordinal position and store in the newly created table)
5-Set up to open a second database, and go through the table in 3, opening each database in turn, then use the routine in 4 to get and record the info
6-repeat step 5 until you have completed for each database on each drive.
I'm sure there are other approaches, but that's what I recall. Hope it's useful to you.
NOTE: I do not have all the procedures on this laptop.
This is the first part of the output based on DOS command on current laptop.
Thank you very much.
I have a file listing of the databases. Now I need to loop through the databases and obtain the table and column names for each local table (not system or linked tables) so that I can determine what needs to be redacted.
- 1 table data_dictionary
- 1 module with 2 procedures you'll need
-----DocumentTables
-----FieldType
Look at table data_dictionary to see the kind of info recorded.
To make this work
Open the module, run DocumentTables
it will delete the table and build it from scratch.
It calls fieldtype to get descriptive names.
NOTE: This is for tables in the current database. I don't have the code for opening a second database, getting the
table and field names and putting those in a table that includes dirve/folder info and database name on this laptop.
If you have the original location of the databases in your list, you can changed the data_dictionary table to allow for the location field. This would be helpful if you have multiple tables with the same names. And if soome tables with same names have different fields.