Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Methodology for Import/Export of Related tables
Message
From
24/08/1999 12:11:03
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, United States
 
 
To
24/08/1999 11:37:32
Shane Gilbert
Oklahoma State Department of Education
Norman, Oklahoma, United States
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00257097
Message ID:
00257136
Views:
18
Hi Shane,
I have a similiar situation. Here's what I do.
1. Each record has an XportID. To export I SELECT all records that have XportID of " " or 0, depending on your IDs.
If a record is updated--deletions count--and it has been exported, you either must create another record--and if the change was a deletion, delete it--or update that changed record to a blank ExportID, but loose the ability to recreate a export package. If you don't allow updates on exported records, then it's much easier. For me I must SET DELETED OFF, then SELECT *, DELETED() AS DelFlag FROM (m.TableName) INTO (ADDBS(SYS(2023)) + m.TableName) WHERE XportID = 0

2. aTables[] array to hold the names of the exportable tables.
3. XportLog table to track files coming in and going out. I use it's XportID and SiteID in combination to get a unique ID. As I import records, I know where it came from, and in what package.
4. Use WinZip or PKZip to zip the files into one file so it's easier to E-mail, whatever. WinZip now has a command line interface. I don't know which program the child sites has, but each command line is about the same. m.Command = _ZipPath + m.ZipType + "Zip.EXE " + _XportPath + _SiteID + m.XportID + ".ZIP " + m.Data + _SiteID + m.XportID + "\*.*"
Files are named by their site and xportID.
5. The import creates a record in the importer's XportLog with the specific of the imported file.
Perhaps this will get you started.
Charlie


>I am working on a project that involves a hierarchy of sites, all running the program I am working on. They are divided into small groups, with one site acting as the parent for several children, and then at the top one master site. Each satellite site needs to export its data to the parent site, where the data will be checked and corrected before it is sent to the master site, where it will again be checked and corrected. The database contains about 6 related tables. The export process needs to allow several options, file,email,and maybe ftp. Any articles or suggestions on good methods to use to accomplish this? Any help will be greatly appreciated.
>
>Shane
Charlie
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform