SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2011
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What is wrong with this small piece of code

    I am getting an error when entering this coding in my page:

    dataRS.MoveFirst
    if dataRS.Find("dbcolumnHeader = 1") then
    Response.Write ("<script language=""javascript"">timedRefresh(30000);</script>")
    else
    Response.Write ("<script language=""javascript"">timedRefresh(300000);</script>")
    End if

    The error says "An error occurred on the server when processing the URL."

  2. #2
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,267
    Mentioned
    116 Post(s)
    Tagged
    1 Thread(s)
    I've never used the find as I just find it easier just to modify the query itself and put the criteria there as that puts the work on the database, not on the recordset object, which isn't the most efficient....

    But if you are going to use that, does your recordset support bookmarks? DevGuru ADO Recordset::Find Method

    Code ASP:
    dataRS.MoveFirst
    if dataRS.Find("dbcolumnHeader = 1") then
        Response.Write ("<script language=""javascript"">timedRefresh(30000);</script>")
    else
        Response.Write ("<script language=""javascript"">timedRefresh(300000);</script>")
    End if
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style
    Learn how to be ready for The Forums' Move to Discourse

  3. #3
    SitePoint Addict itHighway's Avatar
    Join Date
    Jan 2008
    Location
    GUJ
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The find method works if RecordSet supports Bookmark. Try following:
    varBookMark = dataRS.Bookmark
    dataRS.MoveFirst
    dataRS.Find "dbcolumnHeader = 1"
    if NOT dataRS.EOF then
    %><script>timedRefresh(30000);</script><%
    dataRS.Bookmark = varBookMark
    else
    %><script>timedRefresh(3000000);</script><%
    'dataRS.Bookmark = varBookMark
    end if


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
  •