I have a form that uses a default datasession. It sometimes happens that when the form is released, the datasession remains as "Unknown(x)" where x is some number. I've managed to narrow down the lines of code that lead to this situation but I have no idea of why or how to prevent the Unknown(x) datasession from happening.
I've investigated other leads regarding datasessions (like here at UT and FoxWiki) and tried to follow their suggesions but nothing I've tried seems to work.
For those who may be interested, I have an ActiveX control (Mapobjects) on a VFP6 form. In a custom method, I put some code, part of which is as follows:
SELECT maplist
SCAN
pointspcl = placelocator.LOCATE(TRANSFORM(maplist.gis_routen))
IF pointspcl.COUNT > 0
FOR EACH opoint IN pointspcl
ptst1.ADD(opoint)
ENDFOR
ENDIF
ENDSCAN
If I comment out the three lines in the FOR loop, I don't get the problem. If I comment out the ptst1.Add(opoint) line I don't get the problem.
Is there anyway in VFP6 to destroy an Unknown datasession?
TIA
Mike.