![]() |
Database Connection Times Out |
Post Reply ![]() |
Author | |
Donald ![]() Newbie ![]() Joined: 01-September-2010 Location: Alabama Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() 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()%> |
|
![]() |
|
RobertZ ![]() Groupie ![]() Joined: 21-January-2007 Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
Why wouldnt U just use the viewbrands.asp page?
|
|
![]() |
|
Donald ![]() Newbie ![]() Joined: 01-September-2010 Location: Alabama Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
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! |
|
![]() |
|
Greg Dinger ![]() Certified ProductCart Developers ![]() ![]() Joined: 23-September-2006 Location: United States Status: Offline Points: 238 |
![]() ![]() ![]() ![]() ![]() |
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 www.buygolfshirts.net. If you would like us to assist in either regard please e-mail me directly via my web site.
|
|
![]() |
|
Donald ![]() Newbie ![]() Joined: 01-September-2010 Location: Alabama Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
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 :) |
|
![]() |
|
Greg Dinger ![]() Certified ProductCart Developers ![]() ![]() Joined: 23-September-2006 Location: United States Status: Offline Points: 238 |
![]() ![]() ![]() ![]() ![]() |
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.
|
|
![]() |
|
srinioleti ![]() Newbie ![]() Joined: 19-June-2009 Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
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. |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |