thread-> to the gurus... too hard???

Results 1 to 3 of 3

Thread: thread-> to the gurus... too hard???

  1. #1
    Curtis Guest

    Default thread-> to the gurus... too hard???

    someone please help me with the question posted at<BR><BR><BR>thanks. *warning* long and hard.

  2. #2
    Join Date
    Dec 1969

    Default Even beginners can guru needed

    There are just too many silly errors to go into.<BR><BR>None of them are "guru" type errors...just very basic goofs. Just a *smidgen* of debugging would find them.<BR><BR>I can&#039t believe that you sat on this for 12 hours and made no changes or no effort to find the bugs with debugging. Do you really think we can do a better job just staring at the code than you can if you would add some debugging statements?<BR><BR>Here are three things I noticed:<BR><BR>********************<BR><BR>Show me someplace in one of the ASP101 or sites where they do this:<BR><BR>&#060;form method="post" name="frmSearch" action="../scripts/searched.asp?txtSearch=txtSearch&txtNum2List=txtNu m2List"&#062;<BR><BR>Can you read what that says? It says submit to the "searched.asp" page and pass txtSearch as the value of the txtSearch querystring variable. Etc.<BR><BR>So any value entered by the user in this form will be...what?...I don&#039t even know for sure what happens...I suspect that you will end up with *two* values in the ASP page that tries to read the querystring. If you would Response.Write the values in the next page, you&#039d find out. Debug debug debug.<BR><BR>***************<BR><BR>You do this:<BR><BR>if request.querystring("txtSearch") = "" then<BR>response.redirect "../dsisupport/search.html"<BR>end if<BR>... snip ...<BR>sSql = "SELECT * FROM tblMain WHERE KeyWords LIKE &#039%" & sSearch & "%&#039"<BR><BR>Wonderful. Now, where in the world do you ever assign a value to the sSearch variable??? Hmmm??? No place, just incidentally.<BR><BR>If you had simply done Response.Write sSql at some point, you would have discovered this goof.<BR><BR>*******************<BR><BR>You do<BR><BR>&#060;a href="./searched.asp?page=&#060;%=iPageCurrent+1%&#062;&tx tSearch=&#060;%=sSearch)&txtNum2List=&#060;%=iPage Size%&#062;"&#062;Next&#060;/a&#062;<BR><BR>Since when does a ) match up with a &#060;% ???<BR><BR>**********************<BR><BR>There are probably many other goofs, but I don&#039t have time to try to find them all. Start through the code, one step at a time. Put in lots of Response.Write calls to find out what the values of various things are at various places. DEBUG DEBUG DEBUG. Anybody who thinks they can write more than a handful of lines of code and get it all right without actually having to debug is either 1000 times a better programmer than I am or is fooling nobody but themselves.<BR><BR>

  3. #3
    fl1rt Guest

    Default RE: Even beginners can guru needed

    I can&#039t complain with that. very sound advice.<BR><BR>Developers of all levels should learn to use response.write all over the place to be surprised what you think is supposed to be going on compared to what actually is going on.<BR><BR>Credit to Bill for having the patience to wade through those guru-esque goofs (not)...I couldn&#039t bring myself to comment but sit back and smile

Posting Permissions

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