Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 15th, 2005, 09:48 AM
Friend of Wrox
 
Join Date: Aug 2003
Location: Halifax, Nova Scotia, Canada.
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
Reply With Quote
  #2 (permalink)  
Old February 15th, 2005, 06:02 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

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
Reply With Quote
  #3 (permalink)  
Old February 16th, 2005, 10:17 AM
Friend of Wrox
 
Join Date: Aug 2003
Location: Halifax, Nova Scotia, Canada.
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #4 (permalink)  
Old February 22nd, 2005, 09:33 AM
Friend of Wrox
 
Join Date: Aug 2003
Location: Halifax, Nova Scotia, Canada.
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #5 (permalink)  
Old February 22nd, 2005, 06:19 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

;;;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
Reply With Quote
  #6 (permalink)  
Old February 23rd, 2005, 09:51 AM
Friend of Wrox
 
Join Date: Aug 2003
Location: Halifax, Nova Scotia, Canada.
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #7 (permalink)  
Old February 23rd, 2005, 12:40 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

I would always do both - close it & then set it to nothing.

HTH,

Chris

Reply With Quote
  #8 (permalink)  
Old February 23rd, 2005, 12:52 PM
Friend of Wrox
 
Join Date: Aug 2003
Location: Halifax, Nova Scotia, Canada.
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #9 (permalink)  
Old February 23rd, 2005, 06:27 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

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
Reply With Quote
  #10 (permalink)  
Old February 24th, 2005, 09:36 AM
Friend of Wrox
 
Join Date: Aug 2003
Location: Halifax, Nova Scotia, Canada.
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Communications link failure in JBOSS with MYSQL skumar Hibernate 3 August 27th, 2008 11:43 PM
USB Communication BrianWren VB How-To 0 July 21st, 2006 12:40 PM
<link> statement - compile failure to see bug VictorVictor BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 April 18th, 2006 02:26 PM
realtime communication turdy VB.NET 0 February 28th, 2006 10:08 AM
Java - COM Communication nitz_tech J2EE 0 January 12th, 2005 09:33 AM



All times are GMT -4. The time now is 10:45 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.