.Locate using 2 fields and 2 values

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
oz8hp
Posts: 151
Joined: Mon 18 Feb 2008 13:28
Location: Denmark
Contact:

.Locate using 2 fields and 2 values

Post by oz8hp » Wed 30 Jan 2013 12:49

I use now if qryTransactions.Locate('fldyear', 2012, []) then to locate a record and making it the active one.
But I now would like to use 2 fields and 2 values like fldyear = 2012 and fldmonth = 43
Is that possible?

I have been spending a couple of hours with no result

CristianP
Posts: 79
Joined: Fri 07 Dec 2012 07:44
Location: Timișoara, Romania

Re: .Locate using 2 fields and 2 values

Post by CristianP » Wed 30 Jan 2013 13:26

Hallo,

Like for any TDataSet you will need to use:
qryTransactions.Locate('fldyear;fldmonth', VarArrayOf([2012, 43]), [])

Best Regards,
Cristian Peta

oz8hp
Posts: 151
Joined: Mon 18 Feb 2008 13:28
Location: Denmark
Contact:

Re: .Locate using 2 fields and 2 values

Post by oz8hp » Wed 30 Jan 2013 13:53

Thanks - that was what I was looking for.

Post Reply