Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Some Help Deciphering...

Status
Not open for further replies.

tjc240e

Technical User
Joined
Nov 12, 2004
Messages
133
Location
US
I have been given this code which is currently in use in a part of our program. The programmer who developed this is no longer with us and this code does not seem to be working anymore. Im assuming that this is a DynaSet setup?

Anyone give me pointers on this?

Code:
    with AttendData do
    begin
      // for all options
      if TCBInd2.IsOpen then
        TCBInd2.Close;
      TCBInd2.FileNameOverride := CBDataBaseU.DataPath+'CSATTEND.UDB';
      TCBInd2.FileAlias := 'CSATTEND';
      TCBInd2.FileExt := 'UDB';
      TCBInd2.Children.Clear;
      NewChild := TCBInd2.Children.Add; // add First Child[0]
      with NewChild do
      begin
        FileAlias := 'CSREFTBL';
        FileExt := 'UDB';
        FileNameOverride := CBDataBaseU.DataPath+'CSREFTBL.UDB';
        RelationType := rtExact;
        FieldPrefix := 'Lookup->';
        ErrorAction := eaSkip;
        TagName := 'TBL_ID';
        MasterExpr := 'Class_ID';
      end; // with NewChild 0
      // end -- for all options

      if NOT RBPrintAllAttended.Checked then
      begin
        if GGroupID <> 'All Records' then // choose a group file
...
        else
        begin // if GGroupID = 'All Records'
          NewChild := TCBInd2.Children.Add; // Add default Table child 1
          with NewChild do
          begin
            FileAlias := 'CSIND';
            FileExt := 'UDB';
            FileNameOverride := CBDataBaseU.DataPath+'CSIND.UDB';
            RelationType := rtExact;
            FieldPrefix := 'Ind->';
            ErrorAction := eaSkip;
            TagName := 'IND_ID';
            MasterExpr := 'IND_ID';
          end;
        end; // if GGroupID = 'All Records'
      end; // if NOT RBPrintAllAttended.Checked

      TCBInd2.SortExpr := 'ATTD_TYPE+Lookup->DESC';
      if TQEvent <> '' then
        TQuery := TQuery + ' .and. ' + TQEvent;
      TCBInd2.QueryExpr := TQuery;

      ProcessingFrm := TProcessingFrm.Create(Application);
      ProcessingFrm.Show;
      Application.ProcessMessages;

      TCBInd2.Open;
      TCBInd2.GoTop;
      TotalRecords := 0;
 
this code does not seem to be working anymore.

Is it just not doing anything or do you get an error message?

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases:
The Fundamentals of Relational Database Design
Understanding SQL Joi
 
it doesnt appear to be linking the three tables together anymore.

Also im wondering if there isnt a better way to do searches for information rather than using a dynaset?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top