Print Page | Close Window

Database Connection Times Out

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=3966
Printed Date: 15-July-2025 at 8:42pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Database Connection Times Out
Posted By: Donald
Subject: Database Connection Times Out
Date Posted: 01-September-2010 at 6:13pm
Hello,
I am trying to create my own code that can create a static file for a simple list of all the brands in the store. It is a very simple script, but I must have something wrong in how I connect to the database, because when I go to the page it never loads, it just sits there till I get this message;

The maximum amount of time for a script to execute was exceeded. You can change this limit by specifying a new value for the property Server.ScriptTimeout or by changing the value in the IIS administration tools.

This is the code i am using. I really just copied snippets of code from other pages.  Any suggestions as to what I am doing wrong?


<!--#include file="adminv.asp"-->  
<!--#include file="../includes/settings.asp"-->
<!--#include file="../includes/storeconstants.asp"-->
<!--#include file="../includes/opendb.asp"-->

<%
call opendb()
query="SELECT IdBrand, BrandName, BrandLogo FROM Brands WHERE pcBrands_Active=1 ORDER BY BrandName ASC;"
    set rs=connTemp.execute(query)
 %>
<%  
iRecordsShown=0
Do While iRecordsShown < 5 And NOT rs.EOF  
%>
<%
pcIntIDBrand=rs("IdBrand")
pcvBrandsLink="viewBrands.asp?IDBrand=" & pcIntIDBrand
brandlogo = rs("BrandLogo")
brandname = rs("brandname")
%>
<% brandstring = brandstring & "<a href=" & pcvBrandsLink & ">" & "<img src='catalog/" & brandlogo & "'>" & brandname & "</a>" %>
<%
iRecordsShown=iRecordsShown + 1
                        rs.movenext
                        loop
%>

<%
if PPD="1" then
        pcStrFolder=Server.Mappath ("/"&scPcFolder&"/pc")
    else
        pcStrFolder=server.MapPath("../pc")
    end if

    Set fs=Server.CreateObject("Scripting.FileSystemObject")
    Set a=fs.CreateTextFile(pcStrFolder & "\inc_brandlist.inc",True)
    a.Write(brandstring)
    a.Close
    Set a=Nothing
    Set fs=Nothing
%>
<%
call closedb()%>



Replies:
Posted By: RobertZ
Date Posted: 10-September-2010 at 1:42am
Why wouldnt U just use the viewbrands.asp page?


Posted By: Donald
Date Posted: 10-September-2010 at 11:21am
The customer wanted a simple list of the brands on the side of every page, and I wanted to limit the number of calls to the database. But I might just use a modified version of the viewbrands.asp after all. Or else I will just hard code this, as it will be rare for them to add new brands anyway.

Still, if anyone has any suggestion as to what is wrong with my database call above, I would greatly appreciate it.

Thanks!


Posted By: Greg Dinger
Date Posted: 10-September-2010 at 11:43am
Speaking for myself, I try to be as helpful around here in terms of responding to forum questions.  Where I draw the line is trying to debug someone's custom code.  I just don't (and cannot) go there.  It is our coding skills and intimate knowedge of PC on which we base our expertise, and that competes with our basic mission.
 
With that said, if you are still having a problem and want that code fixed, we'd be willing to help on a fee basis.  We also have code that generates a dynamic list of brands.  An example can be seen in http://www.buygolfshirts.net - www.buygolfshirts.net .  If you would like us to assist in either regard please e-mail me directly via my web site.


-------------
GreyBeard Design Group

Certified ProductCart Developer

Web Design/Development/Hosting

http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |


Posted By: Donald
Date Posted: 10-September-2010 at 11:58am
Sorry, didn't mean to step on any toes. Since this forum is about customizing PC I assumed the question was appropriate. I was trying to use the includes and code that were already in PC, which is why I thought someone might have run into this before. I'll figure it out.

I like your add-ons. I might order your quick order entry very shortly - just as soon as I get a signature from the customer I am working :)



Posted By: Greg Dinger
Date Posted: 10-September-2010 at 12:19pm
Not stepping on my toes, or anyone else that I know of.  There are a few of us that regularly respond, and I'm just explaining my absence in this post.  Let us know if we can help - we'd be very eager to do so.

-------------
GreyBeard Design Group

Certified ProductCart Developer

Web Design/Development/Hosting

http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |


Posted By: srinioleti
Date Posted: 10-September-2010 at 12:21pm
Hi Donald,


I tried to run your SQL statement ( SELECT IdBrand, BrandName, BrandLogo FROM Brands WHERE pcBrands_Active=1 ORDER BY BrandName ASC ). I don't see column name pcBrands_Active in brands table (I am using productCart v3.51a) unless you modified table to have that column. I suggest to use Response.write to debug the code.


Thank you,
Srini.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net