When I have 10 tabs in my code, the code doesn't run. When I have 9, it does.

Discussion in 'General troubleshooting' started by tdog, Feb 23, 2011.

  1. Thanks for reading

    I just signed up to this service.

    My ASP classic - MS Access program runs fine at home.

    When I FTP'd it over to Winhost, it stopped working.

    The browser just hangs and hangs and hangs, and nothing ever happens...

    I have isolated the problem down to 10 tabs.

    When my below code has 10 tabs in it, it stops working.
    When I take the tabs out, it works.


    I am using Dreamweaver as my filed editor (if that matters).

    Why is this happening please help...

    I am so confused...

    :(

    :(:confused:


    Code:
    <%
    Dim Conn
    Dim RS
    Dim SQL
    %>
    
    <%
    
    Set Conn = Server.CreateObject("ADODB.connection") 
    Set RS = Server.CreateObject("ADODB.recordset") 
    
    SQL = "SELECT * FROM tableitems"
    Conn.Open "Provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source=" & Server.MapPath("fpdb/artisan.accdb")
    RS.Open SQL, Conn
    
    %>
    
    <% Do while not RS.Eof %>
    	<% = RS.fields("itemid") %><br>
    	1-Tab Marker
    	2-Tab Marker
    	3-Tab Marker
    	4-Tab Marker
    	5-Tab Marker
    	1-Tab Marker
    	2-Tab Marker
    	3-Tab Marker
    	4-Tab Marker
    	5-Tab Marker
    <%
    RS.MoveNext
    Loop 
    %>
    
    <%
    RS.Close
    Set RS = Nothing
    Conn.Close
    Set Conn = Nothing 
    %>
     
    Last edited by a moderator: Oct 14, 2015
  2. Ray

    Ray

    It sounds like the database maybe hanging. Try doing this as a test. Create a simple ASP app. Use a SQL server and have your app connect to it. Recreate the tables you have on your Access to the Winhost SQL server and see if the Winhost SQL server and your web app hangs.
     
    Last edited by a moderator: Oct 14, 2015
  3. Hi, thanks for responding

    >> Create a simple ASP app.

    but, this is a simple ASP app.... isnt it?
    how could it get more simpler?

    >> Use a SQL server and have your app connect to it.

    isnt that what i'm doing in the connection string

    >> Recreate the tables you have on your Access to the Winhost SQL server

    please explain?
     
    Last edited by a moderator: Oct 14, 2015
  4. No, you're connecting to an Access database.

    I think what Ray is saying is try your code on a SQL database and see if you have the same problem. Access is not really meant to be used on a web site. It has a lot of inherent problems and you could be running into one of them.
     
  5. >> try your code on a SQL database and see if you have the same problem

    oh

    well, i realize that access is not the preferred method. but I signed up to this hosting company specifically so i can use an access database...

    I seem to be hitting some sort of "upper bound" in regards to memory allocation or something...

    I am on the minimal Winhost server plan...

    Because when I delete various things, it all starts working again. I just tried deleting all tabs in the txt file and that had no effect...

    to see an example of the hang, go here

    http://artisanreview.com/tonytest.asp
     
    Last edited by a moderator: Oct 14, 2015
  6. Ray

    Ray

    Do you have a test page we can look at where it hangs?
     
  7. OK, i got it working because someone suggested I put

    - Response.Flush

    in the WHILE loop.

    it works now but i dont know why

    Can you please please please tell me WHY that line of code works?

    What exactly am I doing wrong and how can I avoid that?? I've never had to use that line before....

    ; ( tears

    thanks!
     
  8. Ray

    Ray

    Try adding a server.scriptTimeout setting on your asp application. Try setting it to a high value.

    Also as a test see try only pulling up the first 10 or 15 records. Have a Top 10 or Top 15 in your SQL statement. Like I said, I think the Access database is crashing when you are pulling a lot of data from it.
     
  9. >> try only pulling up the first 10 or 15 records

    Yes, this makes it work

    >> Response.Flush

    Yes, this makes it work

    >> server.scriptTimeout

    this, i'm not sure how to use. Is there someway i can, like, see an error message using this function?
     
  10. Ray

    Ray

  11. Thanks

    ok i put Server.ScriptTimeout=999

    and erased response.flush from my code

    results didnt change. the site just kept lagging and lagging as before.

    so far the only thing that works is to put

    response.flush above the RS.MoveNext

    but why?
     
  12. Ray

    Ray

    It simply is hanging the app. And the only thing I can attribute it to is MS Access. As I stated try moving the table to a SQL 2008 server and try it from there.
     
  13. Hi,

    I just had that exact same problem tdog had with my access database. I could only return 10 records in a recordset. If I added 1 record, the asp page would hang with no error displayed.

    By putting response.flush, before .MoveNext, it solved the problem. Too bad it took me all week to figure it out. I never had a problem before (it worked all year).

    I guess I will eventually have import my data to Microsoft SQL.

    Matt
     
  14. Matt, thanks for posting that information. It will be a help to others.
     

Share This Page