Paradox Community

Items in pnews.paradox-programming

Subject:Re: Help with writing tcursor
Date:Thu, 21 May 2020 08:29:26 -0400
From:"Steven Green" <greens@diamondsg.com>
Newsgroups:pnews.paradox-programming
  .....
end while
*tcct1.endedit()*
tcct1.close()
tcct2.close()


I'm just repeating it cuz it's so damn important..

--

Steven Green
Myrtle Beach, South Carolina, USA

http://www.OasisTradingPost.com

Collectibles and Memorabilia
Vintage Lego Sets and Parts
- and Paradox support, too
"Tom Krieg"  wrote in message news:5ec62169$1@pnews.thedbcommunity.com...

    .....
  end while
  *tcct1.endedit()*
  tcct1.close()
  tcct2.close()

On 21/05/2020 4:29 pm, Tom Krieg wrote:
> Don't use tc.locate, it can be tediously slow because it's a sequential 
> read. Use a unique index or primary key and do a tc.qlocate for an instant 
> retrieval. I gave up using queries back in '98 because my files were large 
> and queries took forever.
>
> e.g
> if not tcct1.open then errorshow() return end if
> tf not tcct2.open then errorshow() tcct1.close() return end if
> if not tcct1.edit then errorshow() tcct1.close() tcct2.close() return 
> endif
> tc.ct2.home()
> tcct1.switchindex(MainID)
> while not tcct2.eot()
>     if tcct1.qlocate(tcct2."Mainid" then
>        if tcct1.lockrecord() then
>           --- Update tcct1
>        else
>           --- Error
>        end if
>     else
>        if tcct1.insertrecord() then
>           --- Fill tcct1
>        else
>           --- Error
>        end if
>     end if
>     if Error then
>        tcct1.canceledit()
>        --- show error
>        quitloop
>     else
>        tcct1.unlockrecord()
>        tcct2.nextrecord()
>     end if
> end while
> tcct1.close()
> tcct2.close()
>
>
> On 21/05/2020 7:16 am, Kevin Baker wrote:
>> If you look at the attached picture, I'm trying to update CT1.DB with the 
>> info from CT2.DB.  I've been trying to do this with 12 different queries, 
>> which works somewhat.  I get errors and some GPV, so was looking to see 
>> if this was possible by using a tcursor.
>>
>> I'm thinking if may require a tc.locate and not sure if doing a locate 
>> with a tc is recommended.
>>
>> Any help is very much appreciated.
> 


Copyright © 2004 thedbcommunity.com