home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 October / Chip_2001-10_cd1.bin / zkuste / delphi / kompon / d45 / ARDOCI.ZIP / dOCI_FAQ.txt < prev    next >
Text File  |  2001-03-01  |  917b  |  30 lines

  1. QUESTION:
  2.  
  3.  I dropped a TOraDB and a TAOraSQL components onto a form. I set the properties,
  4.  and TAOraSQL.SQL property to 'select * from real_actl'.
  5.  This table has many fields and it has a field, name TBLA.
  6.  So I tried to open the dataset. Than I got a message: 'Field 'TBLA' not found!'. 
  7.  I missed something?
  8.  
  9. ANSWER:
  10.  
  11.  If you use TAOraSQL for SQL queries your must define all fields manually. 
  12.  If your table has two fields: TBLA(integer) and TBBB(string) your can do next:
  13.  
  14.   AOraSQL.SetSQL('select * from real_actl');
  15.   AOraSQL1.AddField('TBLA',ftoInteger,0,True);
  16.   AOraSQL1.AddField('TBBB',ftoString,50,True);
  17.   AOraSQL.Open;
  18.  
  19.  The other way to call LoadFields method before Open.
  20.  
  21.   AOraSQL.SetSQL('select * from real_actl');
  22.   AOraSQL.LoadFields;
  23.   AOraSQL.Open;
  24.  
  25.  If you use TOraSQL no any additional action need:
  26.  
  27.   OraSQL.SQL.Text:='select * from real_actl';
  28.   OraSQL.Open;
  29.  
  30.