[ RB4] To test a cursor ?
Ruslan Zasukhin
sunshine at public.kherson.ua
Fri Oct 24 08:57:49 CDT 2003
on 10/24/03 8:05, Deane Venske at dean at eduss.com wrote:
> I just thought of something that may be a problem here...
> Ruslan, maybe you could answer this best. Will the function keep a lock
> on the table? It is returning that cursor but it doesn't set it's
> internal cursor to Nil. Is setting the cursor to Nil outside that
> function good enough to release a lock on that table?
You mean this one ?
Function vQuery(sqlQuery As String) As VCursor
Dim queryCursor As VCursor
queryCursor = db.SQLSelect(sqlQuery)
if queryCursor = Nil then
msgbox "The cursor returned was invalid. The SQL being executed was
:" + EndOfLine + sqlQuery + EndOfLine + "Valentina Reported the
following error :" + EndOfLine + db.ErrString
else
return queryCursor
end if
End Function
REALbasic will return cursor object from function and it still will be
alive.
Of course cursor still keep locks.
Internal variable die when you exit function, so only one pointer on cursor
left. -- the one you have return.
When you set it to NIL cursor object die.
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina
mailing list