TQuery EDatabaseError field not found (but yet...)

From: Alexandre Leclerc (aleclerc__at__hotmail_._com)
Date: 07/06/04


Date: Tue, 06 Jul 2004 10:37:31 -0400

Hi all,

I've look arround for a while but found no help for this weird problem.

Using Delphi 3:

I use a TQuery with PostgreSQL ODBC component to get data from the DB
and this is working great. But for a specific query I'm getting this
problem: I can read the first result, but when I come to the next one,
this is telling me the field does not exist. But when I add a watch,
this is working (before I get the error).

Here is the code bellow, and the error message:

--code-begin--
     qryInfPatch.SQL.Clear;
     qryInfPatch.SQL.Add('SELECT * FROM inf_patch.yarn WHERE expire_date
IS NULL;');
     qryInfPatch.Active := True;
     qryInfPatch.First;
     while not qryInfPatch.Eof do
     begin
       Inc(count);
       sgYarn.RowCount := count + 1;
       sgYarn.Rows[count].Add(VarToStr(qryInfPatch['yarn_id']));
       //... other fields...same code
       sgYarn.Rows[count].Add(VarToStr(qryInfPatch['cn_desc']));
       qryInfPatch.Next;
     end;
     qryInfPatch.Active := False; //close query
--code-end--

So the first loop is working good, but when begining the next loop, this
is telling me 'EDatabaseError ... field 'yarn_id' not found...'. I have
no clue of what is going on, since the *same* code works great for other
tables.

Thanks for any help!

-- 
Alexandre Leclerc


Relevant Pages

  • Re: can someone help me...
    ... % Probably the line that gives you the error message. ... as we mentioned before, i=1,thus for the first loop; ... could i put abs in front of the zmeaning: ... % You should read THE MATLAB "Getting Started" documentation. ...
    (comp.soft-sys.matlab)
  • Re: can someone help me...
    ... % Probably the line that gives you the error message. ... as we mentioned before, i=1,thus for the first loop; ... could i put abs in front of the zmeaning: ... % You should read THE MATLAB "Getting Started" documentation. ...
    (comp.soft-sys.matlab)
  • Re: can someone help me...
    ... % Probably the line that gives you the error message. ... as we mentioned before, i=1,thus for the first loop; ... could i put abs in front of the zmeaning: ...
    (comp.soft-sys.matlab)