Showing Temp Rec on Form

I am using a temporary table object to report the results of a DTS Package execution. If the Package has more than one step, I want to report all of them. Whenever I execute a multi-step DTS Package, the form opens with only the last record. I am a novice at manipulating temporary records, so what am I doing wrong? Please see attached. FYI: the TempRec.RESET and TempRec.SETFILTER statements just before opening the form are my lame attempt at trying to get all records to show CLEARALL; CREATE(DTSPackage); DTSPackage.LoadFromSQLServer(ServerName,’’,’’,256,’’,’’,’’,PackageName) ; Steps := DTSPackage.Steps; FOR i := 1 TO DTSPackage.Steps.Count DO Step := DTSPackage.Steps.Item(i); Step.Execute; IF (Step.ExecutionResult = 0) THEN BEGIN TempRec.INIT; TempRec.“Primary Key” := FORMAT(i); TempRec.Text1 := FORMAT(DTSPackage.Steps.Item(i).Name); TempRec.Text3 := ‘Step Successful’; CASE Step.ExecutionStatus OF 4: TempRec.Text2 := ‘Completed’; 3: TempRec.Text2 := ‘Inactive’; 2: TempRec.Text2 := ‘In Progress’; 1: TempRec.Text2 := ‘Waiting’; END; TempRec.INSERT; END ELSE BEGIN TempRec.INIT; TempRec.“Primary Key” := FORMAT(i); TempRec.Text1 := FORMAT(DTSPackage.Steps.Item(i).Name); TempRec.Text3 := ‘Step Failed’; CASE Step.ExecutionStatus OF 4: TempRec.Text2 := ‘Completed’; 3: TempRec.Text2 := ‘Inactive’; 2: TempRec.Text2 := ‘In Progress’; 1: TempRec.Text2 := ‘Waiting’; END; TempRec.INSERT; END; TempRec.RESET; TempRec.SETFILTER(“Primary Key”,’%1…%2’,FORMAT(1),FORMAT(i)); IF TempRec.FIND(’-’) THEN BEGIN FORM.RUN(50190,TempRec); END; DTSPackage.UnInitialize;

Forget it. I added BEGIN / END to my DO routine and I returned all records

Forget it. I added BEGIN / END to my DO routine and I returned all records

Devin, Try adding Message(‘Temp record count =%1’,TempRec.COUNT) …after you have run the DTS package but before you try to run the form the check that you do have multiple records in the temp table. This should tell you if the problem is with populating the temp record or displaying the results in your form. Also it should not really be necessary to apply filters or set record pointers to your temp table before you pass it to the form so your code could end with just… TempRec.RESET; FORM.RUN(50190,TempRec); Regards, Chris. PS. What kind of automation object are you using to control the DTS package from Navision? I have not used it before.

Chris : I guess it’s SQLDMO, this Automation is installed when you install MS SQL client into your machine