 |
| Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

February 15th, 2005, 09:48 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Communication Link Failure Fixer
Why does my webite loose it's link to the database, 3 or 4 times a week.
There is a commfix.asp file that all I have to do is load this page in the broswer and the website is back up everytime. But why does this happen and can it be stopped. I can't check the website 24/7 to see if it's up or not.
Thanks :)
-----------------------------------------------------------
"Don't follow someone who's not going anywhere" John Mason
__________________
-----------------------------------------------------------
\"Don\'t follow someone who\'s not going anywhere\" John Mason
|
|

February 15th, 2005, 06:02 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
A couple of questions:
1..What exact error are you getting (make sure 'show friendly HTTP errors' is turned off)?
2..Is it the same error everytime?
3..Access is it?
4..What is in the commfix.asp file?
;;;I can't check the website 24/7 to see if it's up or not
No, certainly not...
Wind is your friend
Matt
|
|

February 16th, 2005, 10:17 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I can't remember the exact error, but it's the same everytime. It's an sql database. Here is the code for the commfix.asp. With the user name and password gone. It's looks straight forward but why does it need to be run 3-4 times a week.
<%@ Language=VBScript %>
<html>
<head>
<title>Fix Communication Link Failures</title>
</head>
<body>
<b>Communication Link Failure Fixer
<br><br>
Fixing Comm Link ...
<%
Application("DBConn_ConnectionString") = "Description=advocate;DRIVER=SQL Server;SERVER=sql4.webminders.com;UID=advocatesql; APP=????????????????????;WSID=OEMCOMPUTER;DATABASE =advocate;Network=DBMSSOCN;User Id=*******;PASSWORD=******"
Application("DBConn_ConnectionTimeout") = 15
Application("DBConn_CommandTimeout") = 30
Application("DBConn_CursorLocation") = 3
Application("DBConn_RuntimeUserName") = "******"
Application("DBConn_RuntimePassword") = "******"
Set Application("DBConn") = Server.CreateObject("ADODB.Connection")
Application("DBConn").Attributes=adXactCommitRetai ning
Application("DBConn").CommandTimeout=Application(" DBConn_CommandTimeout")
Application("DBConn").ConnectionString=Application ("DBConn_Connection_ConnectionString")
Application("DBConn").ConnectionTimeout=Applicatio n("DBConn_ConnectionTimeout")
Application("DBConn").IsolationLevel=4096
Application("DBConn").Mode=adModeShareDenyNone
Application("ADOVersion")=Application("DBConn").Ve rsion
Application("DBConn").Open Application("DBConn_ConnectionString"),Application ("DBConn_RuntimeUserName"),Application("DBConn_Run timePassword")
%><br>
Comm Link Fixed!
</body>
</html>
-----------------------------------------------------------
"Don't follow someone who's not going anywhere" John Mason
|
|

February 22nd, 2005, 09:33 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
My ISP tells me that the error could be caused by the Record set's not being closed when the user exits the site. Causing a "Communication Link Error" to occur after enough user's have entered and exited the site. Has anyone heard of this before or had this error before?
If what they say is ture could I just close each record set at the bottom of everypage?
Thanks
-----------------------------------------------------------
"Don't follow someone who's not going anywhere" John Mason
|
|

February 22nd, 2005, 06:19 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
;;;I can't remember the exact error, but it's the same everytime
not much help.
;;;My ISP tells me that the error could be caused by the Record set's not being closed
If we could see the error...
Are you not closing record sets? I suggest you do or your pages will be resource hungry
Wind is your friend
Matt
|
|

February 23rd, 2005, 09:51 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks Mat, I did not design this site so I had no idea that the record set's were not being closed. The error comes up on the screen and in just Says "Communication Link Error". My question to you is;
How would I close the record set's?
Here is how each record set is generated:
SQLStr="SELECT TOP 10 * FROM ORArticles WHERE Featured= 0 ORDER by MagID DESC"
Set RS=Server.CreateObject("ADODB.Recordset")
RS.Open SQLStr,Application("DBConn"),adOpenKeyset,adLockPe ssimistic,adCmdText
The connection to the database is held in a global.asa file.
So would all I have to do is after the code is done with the above record set, just set it to nothing, or just close it?
-----------------------------------------------------------
"Don't follow someone who's not going anywhere" John Mason
|
|

February 23rd, 2005, 12:40 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
|
|
I would always do both - close it & then set it to nothing.
HTH,
Chris
|
|

February 23rd, 2005, 12:52 PM
|
|
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Okay thanks Chris :)
I guess I have a lot of work ahead of me ;)
-----------------------------------------------------------
"Don't follow someone who's not going anywhere" John Mason
|
|

February 23rd, 2005, 06:27 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
I have never experienced this "Communication Link Error" - its new to me.
I would suggest:
1.. Only make a connection to the datastore when you need one
2.. Get your records
3.. Use your recordset (or put into an array using myArray=rs.getRows)
4.. Set your rs = nothing
5.. Close your connection
Additionaly, if your get an error paste it into google. When I paste:
'ASP Communication Link Error' the first result holds your solution.
Wind is your friend
Matt
|
|

February 24th, 2005, 09:36 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Awesome, Thanks for the Response Mat, I will keep that in mind for next time.
Thank You Very Much :)
-----------------------------------------------------------
"Don't follow someone who's not going anywhere" John Mason
|
|
 |