dbTalk Databases Forums  

GPV - Access vioaltion - runtime error 216

comp.databases.paradox comp.databases.paradox


Discuss GPV - Access vioaltion - runtime error 216 in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jim Moseley
 
Posts: n/a

Default GPV - Access vioaltion - runtime error 216 - 03-20-2007 , 08:59 AM







To all, and Bertil especially,

I found another way to get a GPV. In Pdox 9 sp3, if you wait on a form,
which in turn waits on another form, then you'll get an access violation
when you try to close them. I couldn't narrow down the exact instruction
that caused the GPV, but I suspect it was the 'f.close()'. Here's the essence
of my code:

;----------------
; Form A's code:
if f.open("FormB") then
retVal = f.wait()
; do some stuff
try f.close() onFail errorClear() endTry
endIf

; Form B's code on a pushButton():
if f.open("FormC") then
retVal = f.wait()
; do some stuff
try f.close() onFail errorClear() endTry
endIf
formReturn(true)

; Form C's code:
;doSomeStuff
formReturn(true)
;----------------

I changed the logic so FormA waited sequentially on FormB then FormC, and
this fixed my GPV.

;---------------
; Form A's code:
if f.open("FormB") then
retVal = f.wait()
if retVal.dataType() = "String" then
if retVal = "FormBButtonPressed" then
if f2.open("FormC") then
retVal = f2.wait()
try f2.close() onFail errorClear() endTry
endIf
endif
endif
try f.close() onFail errorClear() endTry
endIf
formReturn(true)

; Form B's code on a pushButton():
formReturn("FormBButtonPressed")
;----------------


Hope this helps someone else.

Thanks,
Jim Moseley

Reply With Quote
  #2  
Old   
Jim Moseley
 
Posts: n/a

Default Re: GPV - Access vioaltion - runtime error 216 - 03-20-2007 , 10:06 AM







"Tony McGuire" <png.paradoxcommunity@com> wrote:

Quote:
I want each operation completed sequentially.
Is formA still waiting on formB, when formB opens & waits on formC? That
is what I think was causing my GPV.

Actually, I really think it was the 'try f.close()'. I think the form variable
got hosed by the 2nd f.wait()/formreturn().

Jim


Reply With Quote
  #3  
Old   
Tony McGuire
 
Posts: n/a

Default Re: GPV - Access vioaltion - runtime error 216 - 03-20-2007 , 10:08 AM




I have this situation (form a->wait() form b->wait() form c.

I get no gpv. Paradox 9 sp3.

Only thing I can think of that might be different is that I use dialog
windows exclusively for this as I want each operation completed
sequentially.


--
---------------------------------------------------------
Tony McGuire



Reply With Quote
  #4  
Old   
Bertil Isberg
 
Posts: n/a

Default Re: GPV - Access vioaltion - runtime error 216 - 03-20-2007 , 02:58 PM



Jim

In a simple setup, I cannot recreate your problem in P9 SP4.

Can you, if you remove the doSomeStuff() code?

--
Bertil Isberg - CTECH
Paradox buglist:
online: http://hem.bredband.net/bertilisberg/

"Jim Moseley" <jmose (AT) mapson (DOT) attglobal.net> skrev i meddelandet
news:45fff6bc$1 (AT) pnews (DOT) thedbcommunity.com...
Quote:
To all, and Bertil especially,

I found another way to get a GPV. In Pdox 9 sp3, if you wait on a form,
which in turn waits on another form, then you'll get an access violation
when you try to close them. I couldn't narrow down the exact instruction
that caused the GPV, but I suspect it was the 'f.close()'. Here's the
essence
of my code:

;----------------
; Form A's code:
if f.open("FormB") then
retVal = f.wait()
; do some stuff
try f.close() onFail errorClear() endTry
endIf

; Form B's code on a pushButton():
if f.open("FormC") then
retVal = f.wait()
; do some stuff
try f.close() onFail errorClear() endTry
endIf
formReturn(true)

; Form C's code:
;doSomeStuff
formReturn(true)
;----------------

I changed the logic so FormA waited sequentially on FormB then FormC, and
this fixed my GPV.

;---------------
; Form A's code:
if f.open("FormB") then
retVal = f.wait()
if retVal.dataType() = "String" then
if retVal = "FormBButtonPressed" then
if f2.open("FormC") then
retVal = f2.wait()
try f2.close() onFail errorClear() endTry
endIf
endif
endif
try f.close() onFail errorClear() endTry
endIf
formReturn(true)

; Form B's code on a pushButton():
formReturn("FormBButtonPressed")
;----------------


Hope this helps someone else.

Thanks,
Jim Moseley



Reply With Quote
  #5  
Old   
Tom Krieg
 
Posts: n/a

Default Re: GPV - Access vioaltion - runtime error 216 - 03-20-2007 , 06:01 PM



I often call up to 4 forms (formA --> formB --> formC --> formD) without
problem. I do this a lot for drill-down in BOM views and parts
catalogues. The fHandle variable is local to the method calling the next
form, the called form is closed in the calling method immediately after
return and the calling method is local to the form calling the next
form. So formA calls formB in a pushbutton method of formA, formB calls
formC in a method in formB, formC calls formD in a method in formC.
Never had a problem. P7,P9sp3 and now p10sp3.

Jim Moseley wrote:
Quote:
To all, and Bertil especially,

I found another way to get a GPV. In Pdox 9 sp3, if you wait on a form,
which in turn waits on another form, then you'll get an access violation
when you try to close them. I couldn't narrow down the exact instruction
that caused the GPV, but I suspect it was the 'f.close()'. Here's the essence
of my code:

;----------------
; Form A's code:
if f.open("FormB") then
retVal = f.wait()
; do some stuff
try f.close() onFail errorClear() endTry
endIf

; Form B's code on a pushButton():
if f.open("FormC") then
retVal = f.wait()
; do some stuff
try f.close() onFail errorClear() endTry
endIf
formReturn(true)

; Form C's code:
;doSomeStuff
formReturn(true)
;----------------

I changed the logic so FormA waited sequentially on FormB then FormC, and
this fixed my GPV.

;---------------
; Form A's code:
if f.open("FormB") then
retVal = f.wait()
if retVal.dataType() = "String" then
if retVal = "FormBButtonPressed" then
if f2.open("FormC") then
retVal = f2.wait()
try f2.close() onFail errorClear() endTry
endIf
endif
endif
try f.close() onFail errorClear() endTry
endIf
formReturn(true)

; Form B's code on a pushButton():
formReturn("FormBButtonPressed")
;----------------


Hope this helps someone else.

Thanks,
Jim Moseley

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.