[ RB4] To test a cursor ?

Deane Venske dean at eduss.com
Fri Oct 24 16:02:12 CDT 2003


Ruslan Zasukhin wrote:

>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.
>
>  
>
Ah good, thanks for that. I was a little worried.



More information about the Valentina mailing list