Recent

Author Topic: [Solved] Problem in post record-changes: tsqlquery + firebird  (Read 2428 times)

rretamar

  • New Member
  • *
  • Posts: 32
Hi.
I have a problem with tsqlquery component in attemp to write changes in a record (post): if the table contains lookup fields or calculated fields, the program stops and show error in ApplyUpdates with these fields. "The field xxxx don't exist in dabatase"....but these fields than cause the error are lookups or calculared. WTF ????

Using the zeosllib components instead lazarus native components, the post work fine.  ::)

Thanks !  :)
« Last Edit: July 29, 2014, 05:20:54 pm by rretamar »

taazz

  • Hero Member
  • *****
  • Posts: 5363
Re: Problem in post record-changes: tsqlquery + firebird
« Reply #1 on: July 29, 2014, 08:47:09 am »
attach a small example including the database and a form with a post button that shows the problem.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

LacaK

  • Hero Member
  • *****
  • Posts: 577
Re: Problem in post record-changes: tsqlquery + firebird
« Reply #2 on: July 29, 2014, 01:13:05 pm »
Check ProviderFlags of your calculated fields.
You must exclude pfInUpdate

rretamar

  • New Member
  • *
  • Posts: 32
Re: Problem in post record-changes: tsqlquery + firebird
« Reply #3 on: July 29, 2014, 02:16:27 pm »
Check ProviderFlags of your calculated fields.
You must exclude pfInUpdate

I try yo set pfInUpdate to false in all lookups and calculated fields. Work OK for loopup fields, but calculated fields continues generating error "unknown field" in TSqlquery.Applyupdates event.  :o

Thanks !

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Problem in post record-changes: tsqlquery + firebird
« Reply #4 on: July 29, 2014, 02:18:15 pm »
attach a small example including the database and a form with a post button that shows the problem.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

rretamar

  • New Member
  • *
  • Posts: 32
Re: Problem in post record-changes: tsqlquery + firebird
« Reply #5 on: July 29, 2014, 05:20:17 pm »
Solved !!!!

Setting the ProviderFlags properties in lookups and calculated fields as:

pfInUpdate := False

and

pfInWhere := false

The lookups and calculated fields are ignored in post. Thanks !!!!  :D