BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Table does not reflect any changes

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Thu Oct 27, 2005 10:41 pm    Post subject: Table does not reflect any changes Reply with quote



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,
Back to top
Riki Wiki Google
Guest





PostPosted: Mon Oct 31, 2005 12:53 am    Post subject: Re: Table does not reflect any changes Reply with quote



Hoi Koobelek

FYI the newsgroup borland.public.delphi.database do not officially
exist. In general about how to post to Borland news groups you need to
know this:

<http://tinyurl.com/8m5nw>
which links to
<http://delphi.wikicities.com/wiki/Delphi_Newsgroups>
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.