SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast hombre_de_las_ca's Avatar
    Join Date
    Apr 2005
    Location
    Bangalore, India
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question DATABASE access!!!

    well, if i try to use the following the system goes nuts ...every thing becomes slow(SORT OF A HANG and the script doesent even time out) .... what' wrong with it... i am passing to it three values from another page..value 1 has a name where as values 2 and 3 are dates which i want to use to find data from in between these dates. what's wrong here...????
    Code:
    <html>
    <body>
    <%
    PartNameXX = request.form("selList3")
    newvalue1 = request.form("tf1")
    newvalue2 = request.form("tf2")
    set objConn = server.createobject("ADODB.connection")
    strconn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\boost\JaiHind.mdb;Persist Security Info=False"
    objConn.open strconn
    set objrs = server.createobject("ADODB.recordset")
    strsql = "select * from X WHERE PartNameX = '" & PartNameXX & "' AND Date between #" & newvalue1 & "# and #" & newvalue2 & "#;"
    objrs.CursorLocation = 3
    objrs.open strsql, strconn
    response.write "<table border='1' cellspacing='0' width='891' id='AutoNumber1'><tr><td width='127' align='center' bgcolor='#666666' bordercolor='#000000'><font color='#FFFFFF'>Date</font></b></td>h='127' align='center' bgcolor='#666666' bordercolor='#000000'><font color='#FFFFFF'>Part Name</font></b></td><td width='127' align='center' bgcolor='#666666' bordercolor='#000000'><b><font color='#FFFFFF'>Parts Used</font></b></td><td width='127' align='center' bgcolor='#666666' bordercolor='#000000'><b><font color='#FFFFFF'>Parts Added</font></b></td><td width='127' align='center' bgcolor='#666666' bordercolor='#000000'><b><font color='#FFFFFF'>Total Parts Used</font></b></td><td width='127' align='center' bgcolor='#666666' bordercolor='#000000'><b><font color='#FFFFFF'>Total Parts</font></b></td><td width='127' align='center' bgcolor='#666666' bordercolor='#000000'><b><font color='#FFFFFF'>Cost</font></b></td></tr>"
    while Not objrs.EOF
    response.write "<tr>"
    response.write "<td width='127' align='center' bgcolor='#FFFFFF' bordercolor='#000000'><font color='#000000'>" & objrs("date").value & "</font></td>"
    response.write "<td width='127' align='center' bgcolor='#FFFFFF' bordercolor='#000000'><font color='#000000'>" & objrs("PartNameX").value & "</font></td>"
    response.write "<td width='127' align='center' bgcolor='#FFFFFF' bordercolor='#000000'><font color='#000000'>" & objrs("PartUsedToday").value & "</font></td>"
    response.write "<td width='127' align='center' bgcolor='#FFFFFF' bordercolor='#000000'><font color='#000000'>" & objrs("PartTotalToday").value & "</font></td>"
    response.write "<td width='127' align='center' bgcolor='#FFFFFF' bordercolor='#000000'><font color='#000000'>" & objrs("PartUsed").value & "</font></td>"
    response.write "<td width='127' align='center' bgcolor='#FFFFFF' bordercolor='#000000'><font color='#000000'>" & objrs("PartTotal").value & "</font></td>"
    response.write "<td width='127' align='center' bgcolor='#FFFFFF' bordercolor='#000000'><font color='#000000'>" & objrs("Cost").value & "</font></td>"
    response.write "</tr>"
    wend
    objrs.close
    set objrs = nothing
    objconn.close
    set objconn = nothing
    %>
    </table>
    </body>
    </html>

  2. #2
    SitePoint Enthusiast Nawaz Ijaz's Avatar
    Join Date
    Feb 2005
    Location
    Lahore, Pakistan
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This might be bcoz of this that your recordset returning hundreds of thousands of rows. Better go for paging.
    Nawaz Ijaz [Lahore, Pakistan]
    Boy: He is big..i wont like to fight him...
    Achilles: Thatz Y no one wud remember u after thousand years...!!

  3. #3
    Guru Bullschmidt's Avatar
    Join Date
    Apr 2002
    Location
    USA
    Posts
    524
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If the download time is long perhaps condense this which is apparently written (or something similar) for each field in each row:

    response.write "<td width='127' align='center' bgcolor='#FFFFFF' bordercolor='#000000'><font color='#000000'>" & objrs("date").value & "</font></td>"

    Perhaps something like this:

    response.write "<td width='127' align='center'>" & objrs("date").value & "</td>"
    J. Paul Schmidt
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips

  4. #4
    SitePoint Enthusiast hombre_de_las_ca's Avatar
    Join Date
    Apr 2005
    Location
    Bangalore, India
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    notthing of the sort works....the process bar takes for ever to complete so i had set script time out...and that happens about 5 or 6 mins later...what to do???
    HELP!!!
    the error:
    Technical Information (for support personnel)

    Error Type:

    Active Server Pages, ASP 0113 (0x80004005)
    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.
    /try 001/Inventory_use.asp


    Browser Type:
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

    Page:
    POST 63 bytes to /try 001/Inventory_use.asp

    POST Data:
    selList3=Trigger&tf1=4%2F6%2F2005&tf2=4%2F27%2F2005&Submit=VIEW

  5. #5
    SitePoint Enthusiast hombre_de_las_ca's Avatar
    Join Date
    Apr 2005
    Location
    Bangalore, India
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Red face

    hey....sorry for this whole thread...i had forgotten to put a
    "objrs.movenext" in the while statement...
    .'.CAVEMAN.'.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •