Subject: | Re: Tcursor
| Date: | 29 Mar 2019 01:42:37 -0400
| From: | "Kevin Zawicki" <numberjack@wi.rr.com>
| Newsgroups: | pnews.paradox-programming
|
yes
several ways.
locks, etc
maybe if you attached to a tableframe on a form where the table was read
only in the DM?
some ideas
try this
if tc.open() then
if tc.edit() then
endif
endif
or
if tc.open() then
tc.edit()
if tc.isEdit() = false then
endif
endif
or
>The problem with if/endif is that if open fails then Pdox err comes up
>and I would rather it didn't so I switched to try/en
if not tc.edit() then
errorclear()
tc.close()
endif
etc
Peter <peter@removespamwhiteknight.email> wrote:
>Once a tcursor is opened is there is any way tc.edit() can fail?
>
>I used to always do this
>if tcu.open(":alias:Atable") then
> if not tc.edit() then
> tc.close()
> endIf
>endIf
>
>The problem with if/endif is that if open fails then Pdox err comes up
>and I would rather it didn't so I switched to try/endTry
>try
> tc.open(":alias:Atable")
> tc.edit()
>onFail
> msgInfo("error","error msg")
> if tc.isAssigned() then
> tc.close()
> endIf
>endTry
>
>Using try/endTry, will trap a problem with opening but not edit, even if
>I put a write lock (from a different machine) on the table the onFail
>does not trigger. So I am wondering if it is possible that edit could
>ever fail.
>
>Thank you.
>
>Peter
>
>
|