<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: 'Calibri'; COLOR: #000000">
<DIV>Hi Sergey,</DIV>
<DIV> </DIV>
<DIV>I just checked out the Using statement on MSDN. Looks like a perfect fit
here.</DIV>
<DIV> </DIV>
<DIV>Thanks for the tip.</DIV>
<DIV> </DIV>
<DIV>Best Regards,</DIV>
<DIV>Johnny Harris</DIV>
<DIV
style='FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: "Calibri"; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; DISPLAY: inline'>
<DIV style="FONT: 10pt tahoma">
<DIV> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A
title=sergey_pashkov@valentina-db.com
href="mailto:sergey_pashkov@valentina-db.com">Sergey Pashkov</A> </DIV>
<DIV><B>Sent:</B> Monday, March 31, 2014 5:57 AM</DIV>
<DIV><B>To:</B> <A title=valentina@lists.macserve.net
href="mailto:valentina@lists.macserve.net">Valentina Developers</A> </DIV>
<DIV><B>Subject:</B> Re: VDN - Primary Key Constraint & Boolean Fields
Question</DIV></DIV></DIV>
<DIV> </DIV></DIV>
<DIV
style='FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: "Calibri"; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; DISPLAY: inline'>
<DIV dir=ltr>Hi Johnny,
<DIV> </DIV>
<DIV>If you use cursor only in one method locally, you can also create it in a
<B>using</B> block.</DIV>
<DIV>It will be disposed automatically at the end of this block, for example
:</DIV>
<DIV>
<DIV> </DIV>
<DIV>using( IVCursor cursor = db.SqlSelect( "SELECT * FROM tblPerson" ) )</DIV>
<DIV>{</DIV>
<DIV><SPAN style="WHITE-SPACE: pre"></SPAN>// Some code to get data from
cursor</DIV>
<DIV>}</DIV></DIV>
<DIV> </DIV>
<DIV>Best regards,</DIV>
<DIV>Sergey Pashkov.</DIV></DIV>
<DIV class=gmail_extra><BR><BR>
<DIV class=gmail_quote>On Mon, Mar 31, 2014 at 1:39 PM, Johnny Harris <SPAN
dir=ltr><<A href="mailto:johnny@southshore.com"
target=_blank>johnny@southshore.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<DIV style="WORD-WRAP: break-word" dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: 'Calibri'">
<DIV>Thank You Ivan,</DIV>
<DIV> </DIV>
<DIV>I discovered this late yesterday evening. I was just setting the cursor
to Nothing, but realized I need to call cur.Dispose to totally destroy the
cursor.</DIV>
<DIV> </DIV>
<DIV>It is working fine now.</DIV>
<DIV> </DIV>
<DIV>Best Regards,</DIV>
<DIV>Johnny Harris</DIV>
<DIV
style='FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: "Calibri"; FONT-WEIGHT: normal; FONT-STYLE: normal; DISPLAY: inline'>
<DIV style="FONT: 10pt tahoma">
<DIV> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV><B>From:</B> <A title=ivan_smahin@paradigmasoft.com
href="mailto:ivan_smahin@paradigmasoft.com" target=_blank>Ivan Smahin</A>
</DIV>
<DIV><B>Sent:</B> Monday, March 31, 2014 12:09 AM</DIV>
<DIV>
<DIV><B>To:</B> <A title=valentina@lists.macserve.net
href="mailto:valentina@lists.macserve.net" target=_blank>Valentina
Developers</A> </DIV>
<DIV><B>Subject:</B> Re: VDN - Primary Key Constraint & Boolean Fields
Question</DIV></DIV></DIV></DIV>
<DIV> </DIV></DIV>
<DIV
style='FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: "Calibri"; FONT-WEIGHT: normal; FONT-STYLE: normal; DISPLAY: inline'>
<DIV> </DIV>
<DIV>
<DIV class=h5>
<DIV>
<DIV>On Mar 30, 2014, at 5:04 PM, Johnny Harris <<A
href="mailto:johnny@southshore.com"
target=_blank>johnny@southshore.com</A>> wrote:</DIV><BR>
<BLOCKQUOTE type="cite">
<DIV style="WORD-WRAP: break-word" dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: calibri">
<DIV>Ivan,</DIV>
<DIV> </DIV>
<DIV>I can update the record now using the cursor.UpdateRecord method, but
the lock stays on the record unless I close the connection
(VConnection).</DIV>
<DIV> </DIV>
<DIV>Is there a way to release the lock without having to close the
connection? Sorry for such a basic question, but I can find anything in the
docs.</DIV>
<DIV> </DIV>
<DIV>In my code for the Update you can see I call a CloseDatabase() method
in my class, but it only closes the connection if a flag is set to True,
otherwise the</DIV>
<DIV>connection is kept open.</DIV>
<DIV> </DIV></DIV></DIV></DIV></BLOCKQUOTE></DIV>
<DIV> </DIV>You should close (destroy) the cursor to release all the
locks.
<DIV>See our examples.</DIV>
<DIV>
<DIV> </DIV>
<DIV><SPAN
style="FONT-FAMILY: helvetica; FONT-VARIANT: normal; WHITE-SPACE: normal; WORD-SPACING: 0px; BORDER-COLLAPSE: separate; TEXT-TRANSFORM: none; FONT-WEIGHT: normal; FONT-STYLE: normal; LETTER-SPACING: normal; LINE-HEIGHT: normal; TEXT-INDENT: 0px">
<DIV>-- <BR>Best regards,<BR>Ivan Smahin<BR>Senior Software
Engineer<BR>Paradigma Software, Inc<BR>Valentina - The Ultra-Fast
Database<BR><A href="http://www.valentina-db.com/"
target=_blank>http://www.valentina-db.com</A></DIV></SPAN></DIV>
<DIV> </DIV></DIV></DIV></DIV>
<HR>
<DIV>_______________________________________________<BR>Valentina mailing
list<BR><A href="mailto:Valentina@lists.macserve.net"
target=_blank>Valentina@lists.macserve.net</A><BR><A
href="http://lists.macserve.net/mailman/listinfo/valentina"
target=_blank>http://lists.macserve.net/mailman/listinfo/valentina</A><BR></DIV></DIV></DIV></DIV></DIV><BR>_______________________________________________<BR>Valentina
mailing list<BR><A
href="mailto:Valentina@lists.macserve.net">Valentina@lists.macserve.net</A><BR><A
href="http://lists.macserve.net/mailman/listinfo/valentina"
target=_blank>http://lists.macserve.net/mailman/listinfo/valentina</A><BR><BR></BLOCKQUOTE></DIV>
<DIV> </DIV></DIV>
<P>
<HR>
_______________________________________________<BR>Valentina mailing
list<BR>Valentina@lists.macserve.net<BR>http://lists.macserve.net/mailman/listinfo/valentina<BR></DIV></DIV></DIV></BODY></HTML>