why doesn't this script work?

Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: why doesn't this script work?

  1. #1
    Join Date
    Dec 1969
    Posts
    422

    Default why doesn't this script work?

    just wondering if any one could tell me why this script doesn&#039;t work, it only comes up with this error: <BR>The page cannot be displayed <BR>There is a problem with the page you are trying to reach and it cannot be displayed. <BR><BR>any doesn&#039;t work at all,<BR>here is the script:<BR><BR>&#060;html&#062;&#060;head&#062;<BR >&#060;TITLE&#062;dbtablepaged.asp&#060;/TITLE&#062;<BR>&#060;/head&#062;&#060;body bgcolor="#FFFFFF"&#062;<BR>&#060;!--#INCLUDE file="ADOVBS.INC" --&#062;<BR>&#060;%<BR><BR>connectme = "DRIVER=Microsoft Access Driver (*.mdb); DBQ=" &Server.MapPath("db.mdb") & ";user=;PASSWORD="<BR><BR>&#039;connectme="DSN=Stu dent;uid=student;pwd=magic"<BR>sqltemp="select * from data"<BR><BR>mypage=request("whichpage")<BR>If mypage="" then<BR> mypage=1<BR>end if<BR>mypagesize=request("pagesize")<BR>If mypagesize="" then<BR> mypagesize=10<BR>end if<BR>mySQL=request("SQLquery")<BR>IF mySQL="" THEN<BR> mySQL=SQLtemp<BR>END IF<BR><BR>set rstemp=Server.CreateObject("ADODB.Recordset")<BR>r stemp.cursorlocation=aduseclient<BR>rstemp.cachesi ze=5<BR>tempSQL=lcase(mySQL)<BR> badquery=false<BR> IF instr(tempSQL,"delete")&#062;0 THEN<BR> badquery=true<BR> END IF<BR> IF instr(tempSQL,"insert")&#062;0 THEN<BR> badquery=true<BR> END IF<BR> IF instr(tempSQL,"update")&#062;0 THEN<BR> badquery=true<BR> END IF<BR> If badquery=true THEN<BR> response.write "Not a SELECT Statement<BR>"<BR> response.end<BR> END IF<BR><BR>rstemp.open mySQL,connectme<BR>rstemp.movefirst<BR>rstemp.page size=mypagesize<BR>maxpages=cint(rstemp.pagecount) <BR>maxrecs=cint(rstemp.pagesize)<BR>rstemp.absolu tepage=mypage<BR>howmanyrecs=0<BR>howmanyfields=rs temp.fields.count -1<BR>response.write "Page " & mypage & " of " & maxpages & "<BR>"<BR>response.write "&#060;table border=&#039;1&#039;&#062;&#060;tr&#062;"<BR><BR>& #039;Put Headings On The Table of Field Names<BR>FOR i=0 to howmanyfields<BR> response.write "&#060;td&#062;&#060;b&#062;" & rstemp(i).name & "&#060;/b&#062;&#060;/td&#062;"<BR>NEXT<BR>response.write "&#060;/tr&#062;"<BR><BR>&#039; Now loop through the data<BR>DO UNTIL rstemp.eof OR howmanyrecs&#062;=maxrecs<BR> response.write "&#060;tr&#062;"<BR> FOR i = 0 to howmanyfields<BR> fieldvalue=rstemp(i)<BR> If isnull(fieldvalue) THEN<BR> fieldvalue="n/a"<BR> END IF<BR> If trim(fieldvalue)="" THEN<BR> fieldvalue="&nbsp;"<BR> END IF<BR> response.write "&#060;td valign=&#039;top&#039;&#062;"<BR> response.write fieldvalue<BR> response.write "&#060;/td&#062;"<BR> next<BR> response.write "&#060;/tr&#062;"<BR> rstemp.movenext<BR> howmanyrecs=howmanyrecs+1<BR>LOOP<BR>response.writ e "&#060;/table&#062;&#060;p&#062;"<BR><BR>&#039; close, destroy<BR>rstemp.close<BR>set rstemp=nothing<BR><BR>&#039; Now make the page _ of _ hyperlinks<BR>Call PageNavBar<BR><BR>sub PageNavBar()<BR> &#039; Thanks to Jeff Emrich &#060;jeff.emrich@datafuse.com&#062;<BR> pad=""<BR> scriptname=request.servervariables("script_name")< BR> response.write "&#060;table rows=&#039;1&#039; cols=&#039;1&#039; width=&#039;97%&#039;&#062;&#060;tr&#062;"<BR> response.write "&#060;td&#062;"<BR> response.write "&#060;font size=&#039;2&#039; color=&#039;black&#039; face=&#039;Verdana, Arial,Helvetica, sans-serif&#039;&#062;"<BR> if (mypage mod 10) = 0 then<BR> counterstart = mypage - 9<BR> else<BR> counterstart = mypage - (mypage mod 10) + 1<BR> end if<BR> counterend = counterstart + 9<BR> if counterend &#062; maxpages then counterend = maxpages<BR> if counterstart &#060;&#062; 1 then<BR> ref="&#060;a href=&#039;" & scriptname<BR> ref=ref & "?whichpage=" & 1<BR> ref=ref & "&pagesize=" & mypagesize<BR> ref=ref & "&sqlQuery=" & server.URLencode(mySQL)<BR> ref=ref & "&#039;&#062;First&#060;/a&#062;&nbsp;:&nbsp;"<BR> Response.Write ref<BR><BR><BR> ref="&#060;a href=&#039;" & scriptname<BR> ref=ref & "?whichpage=" & (counterstart - 1)<BR> ref=ref & "&pagesize=" & mypagesize<BR> ref=ref & "&sqlQuery=" & server.URLencode(mySQL)<BR> ref=ref & "&#039;&#062;Previous&#060;/a&#062;&nbsp;"<BR> Response.Write ref<BR> end if<BR> Response.Write "["<BR> for counter=counterstart to counterend<BR> If counter&#062;=10 then<BR> pad=""<BR> end if<BR> if cstr(counter) &#060;&#062; mypage then<BR> ref="&#060;a href=&#039;" & scriptname<BR> ref=ref & "?whichpage=" & counter<BR> ref=ref & "&pagesize=" & mypagesize<BR> ref=ref & "&sqlQuery=" & server.URLencode(mySQL)<BR> ref=ref & "&#039;&#062;" & pad & counter & "&#060;/a&#062;"<BR> else<BR> ref="&#060;b&#062;" & pad & counter & "&#060;/b&#062;"<BR> end if<BR> response.write ref<BR> if counter &#060;&#062; counterend then response.write " "<BR> next<BR> Response.Write "]"<BR> if counterend &#060;&#062; maxpages then<BR> ref="&nbsp;&#060;a href=&#039;" & scriptname<BR> ref=ref & "?whichpage=" & (counterend + 1)<BR> ref=ref & "&pagesize=" & mypagesize<BR> ref=ref & "&sqlQuery=" & server.URLencode(mySQL)<BR> ref=ref & "&#039;&#062;Next&#060;/a&#062;"<BR> Response.Write ref<BR><BR><BR> ref="&nbsp;:&nbsp;&#060;a href=&#039;" & scriptname<BR> ref=ref & "?whichpage=" & maxpages<BR> ref=ref & "&pagesize=" & mypagesize<BR> ref=ref & "&sqlQuery=" & server.URLencode(mySQL)<BR> ref=ref & "&#039;&#062;Last&#060;/a&#062;"<BR> Response.Write ref<BR> end if<BR> response.write "<BR>&#060;/font&#062;"<BR> response.write "&#060;/td&#062;"<BR> response.write "&#060;/table&#062;"<BR>end sub<BR>%&#062;<BR>&#060;/body&#062;&#060;/html&#062;<BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    999

    Default turn off...

    turn off friendly HTTP errors in your browser settings then you will get a more meaningful error message that will help to let you know where you have gone wrong

  3. #3
    Join Date
    Dec 1969
    Posts
    1,032

    Default RE: why doesn't this script work?

    1) turn off friendly error messages in your browser<BR>2) give line details as to where the error occurs<BR>3) post the relevant code surrounding the error<BR><BR>you may then get someone to help you !!

  4. #4
    Join Date
    Dec 1969
    Posts
    422

    Default RE: turn off...

    I tried that and still get the same thing,


  5. #5
    Join Date
    Dec 1969
    Posts
    999

    Default RE: turn off...

    you can&#039;t have done if you are still getting just &#039;page can&#039;t be displayed&#039; - unless that URL doesn&#039;t exist.<BR><BR>the setting you need to uncheck is in tools&#062;internet options&#062;advanced &#062; browsing<BR><BR>In IE that is

  6. #6
    Join Date
    Dec 1969
    Posts
    422

    Default RE: why doesn't this script work?

    I tried that, but I still get no errors,<BR>just dopesn&#039;t run,<BR>is there a configuration change that I could make on the server side so show errors?<BR>also I&#039;ve tryied enabling client side debugging, but that doesn&#039;t seem to be working either,<BR>any ideas?<BR>thanks in advance for your time!

  7. #7
    Join Date
    Dec 1969
    Posts
    2,334

    Default if in case you have done that

    then add these couple of lines at the top of the page and let us know if you see any value in the browser.<BR><BR>&#060;%<BR>response.write "page displayed"<BR>response.end<BR>%&#062;

  8. #8
    Join Date
    Dec 1969
    Posts
    422

    Default RE: turn off...

    yes, I know about the option, and I&#039;ve disabled it, but still getting the same thing, and the file does exist,<BR>is there a server side configuration change that I could make?

  9. #9
    Join Date
    Dec 1969
    Posts
    422

    Default RE: if in case you have done that

    ok, I added that, and still nothing,<BR>this is the link: http://www.by-code.com/gb/page.asp<BR>not sure whats wrong with this,<BR>maybe something is wrong with IIS on my server,,?

  10. #10
    Join Date
    Dec 1969
    Posts
    1,032

    Default your error is

    Active Server Pages error &#039;ASP 0126&#039; <BR><BR>Include file not found <BR><BR>/gb/page.asp, line 10 <BR><BR>The include file &#039;ADOVBS.INC&#039; was not found. <BR><BR>jon

Posting Permissions

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