๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.database
Article #208

Table does not reflect any changes

#208
From: koobelek
Date: Thu, 27 Oct 2005 18:41
98 lines
3346 bytes
Hello,


I have two procedures in my program:


--- Cut ---
// This procedure changes "Completed"
procedure TForm1.dlCompleteProcess(ProcID:Integer);
begin
 ZPutProcesses.Active := True;
 if ZPutProcesses.Locate('ProcessID',ProcID,[]) = True then
  begin
   ZPutProcesses.Edit;
    ZPutProcesses.FieldByName('Completed').AsBoolean := True;
   ZPutProcesses.Post;
  end;
 ZPutProcesses.Active := False;
end;
--- Paste ---


Next procedure populates a string grid with data received from
the same table (Processes).


--- Cut --
procedure TForm1.dlListProcesses(Serial:String);
var WOID    ,
    intRow  : Integer;
begin


 if ZWorkOrder.Locate('WorkOrder',Serial,[]) = true then
  begin


   ZPutProcesses.Active := False;
   ZPutProcesses.Active := True;


   WOID := ZWorkOrder.FieldByName('WorkOrderID').AsInteger;


   ZPutProcesses.Filter   := 'WorkOrderID=' + IntToStr(WOID);
   ZPutProcesses.Filtered :=  True;
   ZPutProcesses.First;


   ShortDateFormat := 'mm/dd/yy';
   labStart.Caption :=
DateToStr(ZWorkOrder.FieldByName('Start').AsDateTime);


   intRow := 1;
   repeat
    sgProcesses.Col := 0;


sgProcesses.Rows[intRow].Add(ZPutProcesses.FieldByName('ProcessName').AsStrยญing);

    sgProcesses.Col := 1;
    if ZPutProcesses.FieldByName('Completed').AsBoolean = True then
     sgProcesses.Rows[intRow].Add('YES')
    else
     sgProcesses.Rows[intRow].Add('NO');
    ZPutProcesses.Next;
    Inc(intRow);
    if ZPutProcesses.Eof <> True then sgProcesses.RowCount := intRow +
1;
   until ZPutProcesses.Eof = True;


   sgProcesses.Col := 0;
   sgProcesses.Row := 1;


   ZPutProcesses.Filter   := '';
   ZPutProcesses.Filtered :=  False;
   ZPutProcesses.Active := False;
  end
end;
--- Paste --


ZPutProcesses is TZTable; { descendant of regular TTable class }


First, I call dlCompleteProcess then I call dlListProcesses. The
problem is that table does not reflect any changes made by
dlCompleteProcess. I'm using ZEOS lib to connect my program to the
MySQL database tables. I would appreciate any comments, suggestions or
code samples. 


Regards, 
Koobel,
Technical Details
Message-ID: <1130438464.247213.279170@o13g2000cwo.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!o13g2000cwo.googlegroups.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 115d96,1e27c2d14c572622,start
X-Google-Attributes: gid115d96,public
X-Google-Language: ENGLISH,ASCII
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!o13g2000cwo.googlegroups.com!not-for-mail
From: koobelek@hotmail.com
Newsgroups: borland.public.delphi.database
Subject: Table does not reflect any changes
Date: 27 Oct 2005 11:41:04 -0700
Organization: http://groups.google.com
Lines: 99
Message-ID: <1130438464.247213.279170@o13g2000cwo.googlegroups.com>
NNTP-Posting-Host: 208.159.153.23
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1130438469 24039 127.0.0.1 (27 Oct 2005 18:41:09 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 27 Oct 2005 18:41:09 +0000 (UTC)
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: o13g2000cwo.googlegroups.com; posting-host=208.159.153.23;
   posting-account=Jia60Q0AAABVjcweVVMD99iwOOEIMDrF