Logo Head Picture  free e- mail 
 thaimail 
 hotmail 
 yahoo 
 siam2you 
 thammasat
 Home  Visual Basic Active Server Page  JavaScript   Network   Other 
 Active Server Pages.











PROPERTY:  Response.IsClientConnected

Modified in version 3.0

The IsClientConnected property determines if the client has disconnected from the server since the last Response.Write. This property is particularly useful since it will prevent the server from continuing to attempt to pass information after an unexpected disconnect.

In ASP 2.0, you must first attempt to pass information to the client in order to use this property. However, in ASP 3.0 you can check the response of using this property before passing any content to the client. (Thus, a simple test will prevent the server from performing unneccesary work.)

In the example code, the output will be a list of all the book titles that are in the database. However, if the user stops the connection to the server, then the only a partial list of titles will be created.

Code:
<%
set connDB=server.createobject("adodb.connection")
connDB.Open "books", "", ""
mySQL="select * from books"
Set rsBookSrch = Server.CreateObject("ADODB.Recordset")
rsBookSrch.Open mySQL, connDB, adOpenStatic, adLockPessimistic
%>
<HTML>
<HEAD>
</HEAD>
<BODY>
<%
Do until (rsBookSrch.eof or Response.IsClientConnected=false)
Response.Write rsBookSrch.Fields("Title") %> <br>
<% rsBookSrch.MoveNext
Loop
rsBookSrch.Close
connDB.Close
%>
</BODY>
</HTML>

Copyright 2000 by Infinite Software Solutions, Inc.
Trademark Information

ASP - Link
ASP reference   
B   
C   
D   
E   
F   
G   
Last update: Copyright © 2001.Memo Wil@keo everything that I like Co.,Ltd.