>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 have tackled the same problem in a similar fashion- but I am curious- how does your scheme handle 2 packages from the same site in rapid succession? Will the first file be overwritten and the changes lost?
Erik Moore
Clientelligence