ewaldt at gdls.com
ewaldt at gdls.com
Tue Feb 6 14:18:01 CST 2007
I have a database with a self-related table. I'll use a simplified example table: PartNumber PartDescription Parent Qty As should be obvious from the field names, the PartNumber is related as a child to its given Parent. Access is not to be the database for this project (sorry for the blasphemy; it's not my idea). There is a vertical application DB (I'll call it VADB) with CAD-type capabilities that Access does not possess (OTOH, the rest of the VADB is 80s technology; it's run in a DOS window, and minimum requirements include DOS 5 and a 386!). I am trying to use Access as an intermediary to convert data from a UNIX flat file to this VADB. I need to produce a text file in the format the VADB requires for importing. The target file would look like this, with each line below representing a line in the target file: Parent (and all data on the parent) .Child (and all data on the child) .Child (and all data on the child) ..Grandchild (and all data on the grandchild) .Child (and all data on the child) And so forth. The leading dots are necessary, although I could probably insert those manually or export the whole puppy to Excel and have Excel do it via VBA. The main point is that all of the lineage has to be included. That is, all of the "grandchildren" have to appear every time they're in a "child'; if the original table has only 200 records, the resulting target file could easily have over 1000, with many of the records repeated many times. The closest I've come is to create a report grouped by the Parent and export it to Excel. However, this only goes down one level, and does not include the leading dots, of course. Is there a way to have Access go down all levels? Is there a better way to do the whole thing? TIA, Tom Ewald GDLS Thomas F. Ewald FCS Database Manager General Dynamics Land Systems (586) 276-1256 This is an e-mail from General Dynamics Land Systems. It is for the intended recipient only and may contain confidential and privileged information. No one else may read, print, store, copy, forward or act in reliance on it or its attachments. If you are not the intended recipient, please return this message to the sender and delete the message and any attachments from your computer. Your cooperation is appreciated.