1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
|
<HTML>
<HEAD>
<TITLE>prguide.htm</TITLE>
<LINK REL="ToC" HREF="httoc.htm">
<LINK REL="Index" HREF="htindex.htm">
<LINK REL="Next" HREF="prguid10.htm">
<LINK REL="Previous" HREF="prguide8.htm"></HEAD>
<BODY BGCOLOR="#FFFFFF">
<P ALIGN=CENTER>
<A HREF="prguide8.htm" TARGET="_self"><IMG SRC="graprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Previous Page"></A>
<A HREF="httoc.htm" TARGET="_self"><IMG SRC="gratoc.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="TOC"></A>
<A HREF="htindex.htm" TARGET="_self"><IMG SRC="graindex.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Index"></A>
<A HREF="prguid10.htm" TARGET="_self"><IMG SRC="granext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A>
<HR ALIGN=CENTER>
<P>
<UL>
<LI>
<A HREF="#E9E10" >Terminating Transactions and Connections</A>
<UL>
<LI>
<A HREF="#E10E37" >Terminating Statement Processing</A>
<LI>
<A HREF="#E10E38" >Terminating Transactions</A>
<LI>
<A HREF="#E10E39" >Terminating Connections</A></UL></UL>
<HR ALIGN=CENTER>
<A NAME="E9E10"></A>
<H1>
<FONT FACE="Arial"><B>TERMINATING TRANSACTIONS AND CONNECTIONS</B><A NAME="I2"></A></FONT></H1>
<BR>
<BLOCKQUOTE>
<P>The ODBC interface provides functions that terminate statements, transactions, and connections, and free statement (<I>hstmt</I>), connection (<I>hdbc</I>), and environment (<I>henv</I>) handles.
</BLOCKQUOTE>
<A NAME="E10E37"></A>
<H2>
<FONT FACE="Arial"><B>Terminating Statement Processing</B><A NAME="I3"></A><A NAME="I4"></A></FONT></H2>
<BLOCKQUOTE>
<P>To free resources associated with a statement handle, an application calls <B>SQLFreeStmt</B>. The <B>SQLFreeStmt</B> function has four options:<A NAME="I5"></A><A NAME="I6"></A>
</BLOCKQUOTE>
<UL>
<BLOCKQUOTE>
<LI><B>SQL_CLOSE</B> Closes the cursor, if one exists, and discards pending results. The application can use the statement handle again later.<A NAME="I7"></A>
</BLOCKQUOTE>
<BLOCKQUOTE>
<LI><B>SQL_DROP</B> Closes the cursor if one exists, discards pending results, and frees all resources associated with the statement handle.<A NAME="I8"></A><A NAME="I9"></A>
</BLOCKQUOTE>
<BLOCKQUOTE>
<LI><B>SQL_UNBIND</B> Frees all return buffers bound by <B>SQLBindCol</B> for the statement handle.<A NAME="I10"></A>
</BLOCKQUOTE>
<BLOCKQUOTE>
<LI><B>SQL_RESET_PARAMS</B> Frees all parameter buffers requested by <B>SQLBindParameter</B> for the statement handle.<A NAME="I11"></A><A NAME="I12"></A><A NAME="I13"></A><A NAME="I14"></A>
</BLOCKQUOTE></UL>
<BLOCKQUOTE>
<P>To cancel a statement that is executing asynchronously, an application:<A NAME="I15"></A>
</BLOCKQUOTE>
<UL>
<BLOCKQUOTE>
<LI>Calls <B>SQLCancel</B>. When and if the statement is actually canceled is driver- and data source–dependent.<A NAME="I16"></A>
</BLOCKQUOTE>
<BLOCKQUOTE>
<LI>Calls the function that was executing the statement asynchronously. If the statement is still executing, the function returns SQL_STILL_EXECUTING; if it was successfully canceled, the function returns SQL_ERROR and SQLSTATE S1008 (Operation canceled); if it completed normal execution, the function returns any valid return code, such as SQL_SUCCESS or SQL_ERROR.<A NAME="I17"></A>
</BLOCKQUOTE>
<BLOCKQUOTE>
<LI>Calls <B>SQLError</B> if the function returned SQL_ERROR. If the driver successfully canceled the function, the SQLSTATE will be S1008 (Operation canceled).
</BLOCKQUOTE></UL>
<A NAME="E10E38"></A>
<H2>
<FONT FACE="Arial"><B>Terminating Transactions</B><A NAME="I18"></A><A NAME="I19"></A><A NAME="I20"></A><A NAME="I21"></A></FONT></H2>
<BLOCKQUOTE>
<P>An application calls <B>SQLTransact</B> to commit or roll back the current transaction.
</BLOCKQUOTE>
<A NAME="E10E39"></A>
<H2>
<FONT FACE="Arial"><B>Terminating Connections</B><A NAME="I22"></A><A NAME="I23"></A><A NAME="I24"></A><A NAME="I25"></A><A NAME="I26"></A><A NAME="I27"></A></FONT></H2>
<BLOCKQUOTE>
<P>To terminate a connection to a driver and data source, an application performs the following steps:<A NAME="I28"></A>
</BLOCKQUOTE>
<UL>
<BLOCKQUOTE>
<LI>1. Calls <B>SQLDisconnect</B> to close the connection. The application can then use the handle to reconnect to the same data source or to a different data source.<A NAME="I29"></A>
</BLOCKQUOTE>
<BLOCKQUOTE>
<LI>2. Calls <B>SQLFreeConnect</B> to free the connection handle and free all resources associated with the handle.<A NAME="I30"></A>
</BLOCKQUOTE>
<BLOCKQUOTE>
<LI>3. Calls <B>SQLFreeEnv</B> to free the environment handle and free all resources associated with the handle.
</BLOCKQUOTE></UL><P ALIGN=CENTER>
<A HREF="prguide8.htm" TARGET="_self"><IMG SRC="graprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Previous Page"></A>
<A HREF="httoc.htm" TARGET="_self"><IMG SRC="gratoc.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="TOC"></A>
<A HREF="htindex.htm" TARGET="_self"><IMG SRC="graindex.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Index"></A>
<A HREF="prguid10.htm" TARGET="_self"><IMG SRC="granext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A>
<center><p><font SIZE=-2>Copyright © 1992-1997 Solid Information Technology Ltd All rights reserved.</font></p></center>
</BODY></HTML>
|