Recent

Author Topic: SQLITE3DATASER  (Read 2360 times)

eldonfsr

  • Sr. Member
  • ****
  • Posts: 278
SQLITE3DATASER
« on: December 25, 2021, 08:09:02 am »
Well lastly i have a problem testing deferent components this time i made a test with tsqlite3datase,  first time run without problem because table is empty  but when run  with
 not empty table  delete datas send me error field not found, i don't know if is possible run sql on it. just after append send me error not found.

Code: Pascal  [Select][+][-]
  1.  if( DParts.Active = true) then begin
  2.       if( not DParts.EOF) then begin
  3.          DParts.SQL:='delete from parts;';
  4.          DParts.ExecSQL;
  5.          DParts.ApplyUpdates;
  6.          DParts.Refresh;
  7. //         DParts.close;
  8.        end;
  9.  
  10.   end;
  11.   DParts.open;
  12.   if( (SQLQPLL.Active = true) and (DParts.Active=true)) then begin
  13.     SQLQPLL.First;
  14.     while(not SQLQPLL.EOF) do begin
  15.       DParts.Append;
  16.       DParts.FieldByName('PartNumber').AsString:= SQLQPLL.FieldByName('plpnpartnumber').AsString;
  17.       DParts.FieldByName('ParentPart').AsString:= SQLQPLL.FieldByName('plpnParentPart').AsString;
  18.       DParts.FieldByName('Supplier').AsString:= SQLQSU.FieldByName('susupplier').AsString;
  19.       DParts.FieldByName('qty').AsInteger:= SQLQPLL.FieldByName('plqty').AsInteger;
  20.       DParts.FieldByName('item').AsInteger:=SQLQPLL.FieldByName('PLItem').AsInteger;
  21.       DParts.FieldByName('Item').AsInteger:= SQLQPLL.FieldByName('PLItem').AsInteger;
  22.       DParts.FieldByName('PLMfrpnid').AsInteger:= SQLQPLL.FieldByName('PLMfrpnId').AsInteger;
  23.       DParts.FieldByName('PLMfrid').AsInteger:= SQLQPLL.FieldByName('PLMfrId').AsInteger;
  24.       DParts.FieldByName('Title').AsString := SQLQPLL.FieldByName('PnTitle').AsString;
  25.       DParts.FieldByName('Detail').AsString:= SQLQPLL.FieldByName('PnDetail').AsString;
  26.       DParts.FieldByName('Type').AsString:= SQLQPLL.FieldByName('PnType').AsString;
  27.       DParts.FieldByName('Stock').AsInteger:= SQLQPLL.FieldByName('PnQty').AsInteger;
  28.       DParts.FieldByName('lnkvendorPN').AsString:= SQLQLNK.FieldByName('LnkVendorPn').AsString;
  29.       DParts.FieldByName('lnkvendorDesc').AsString:= SQLQLnk.FieldByName('LnkVendorDesc').AsString;
  30.       DParts.FieldByName('units').AsString:= SQLQPLL.FieldByName('unuseunits').AsString;
  31.  
  32.       DParts.post;
  33.       DParts.ApplyUpdates;
  34.       SQLQPLL.Next;
  35.     end;
  36.  
  37.  
  38.  
 

 

TinyPortal © 2005-2018