Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > BOOK: Beginning ASP 3.0
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 18th, 2004, 02:52 PM
Authorized User
 
Join Date: Jun 2004
Location: Belfast, , United Kingdom.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 13 - large record set causing error with A

Working my way through Wrox Beginning ASP 3.0 to enable review of legacy code. Chapter 13 Using Record sets. Download a file from wrox site movies2000.mdb and create pages to extract record sets. Ran into some problems so eventually I downloaded the asp files from the wrox site these pages had the same problems. Basically, when pulling a record set of movies, and directors which totals 330 rows, the code Moving.ASP returns masses of largely unintelligible gibberish, though it does appear to reading something from ASP, like connection strings etc. If I reduce the recordset to 295 (from 330) eveything works fine, (wrox code and mine). I had a similar problem latterwith the StaffTable.asp where the record set was 1000+ a quick delete (to approx 295 records) and everything works fine. So it does appear to be a problem with the size of the recordset for either IIS, ASP or the browser. My OS is Windows 2000 Professional (IIS5), 512M Ram, IE6, . My Access is Access 2000 but the Wrox file is older than this probably Access97. I didn't convert it but I did open the files for a look see. The tables seem intact. Any suggestions?
  #2 (permalink)  
Old June 19th, 2004, 04:17 AM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

Can you post the code you're using to access the database? And what database are you using? This one: http://web.wrox.com/0764543636/movie2000for97.zip

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Debra by Beck (From the album: Midnite vultures) What's This?
  #3 (permalink)  
Old June 19th, 2004, 07:07 AM
Authorized User
 
Join Date: Jun 2004
Location: Belfast, , United Kingdom.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Database downloaded from http://www.wrox.com/dynamic/books/download.aspx Chapter 12. This has a zipped database which was unzipped to C:\DataStores as per instructions. The code that I am having a problem with is from the Chapter 13 download Moving.asp (and also StaffTable.asp)

Code is below, (I attach a slightly shortened version which does work to prove that the Recordset and connection are established. This does a simple Response.Write objRS.RecordCount (Returns 330 correct) Note: the main listing works perfectly if I reduce the number of records to 295. Perhaps there has been a corruption in the unzipping but I have repeated the download and unzipped and Access seems to handling the tables itself OK.

/HEAD>
<BODY>

<%
  Dim intChosenRecord, strDirection, strOutputString, intCounter, intNoOfRecords
  If Request.Form("ChosenRec") <> "" Then
    intChosenRecord = Request.Form("ChosenRec")
    strDirection = Request.Form("Dir")
  Else
    intChosenRecord = 1
    strDirection = "Forward"
  End If

  Dim objRS
  Set objRS = Server.CreateObject("ADODB.Recordset")
  objRS.Open "AllMovies", strConnect, adOpenStatic, adLockReadOnly, adCmdTable
  intNoOfRecords = objRS.RecordCount
  objRS.Move intChosenRecord-1

  strOutputString = "<TABLE BORDER=1>" & _
                    "<TR><TD WIDTH=""30%""><B>Director</B></TD>" & _
                        "<TD><B>Film<B></TD></TR>"
  If strDirection = "Forward" Then
    While Not objRS.EOF
      strOutputString = strOutputString & "<TR>" & _
        "<TD>&nbsp;" & objRS("TitleID") & ": " & objRS("Director") & "</TD>" & _
        "<TD>" & objRS("Title") & "</TD>" & _
        "</TR>"
      objRS.MoveNext
    Wend
    objRS.MoveFirst
    For intCounter = 1 To intChosenRecord-1
      strOutputString = strOutputString & "<TR>" & _
        "<TD>&nbsp;" & objRS("TitleID") & ": " & objRS("Director") & "</TD>" & _
        "<TD>" & objRS("Title") & "</TD>" & _
        "</TR>"
      objRS.MoveNext
    Next
  Else
    While Not objRS.BOF
      strOutputString = strOutputString & "<TR>" & _
        "<TD>&nbsp;" & objRS("TitleID") & ": " & objRS("Director") & "</TD>" & _
        "<TD>" & objRS("Title") & "</TD>" & _
        "</TR>"
      objRS.MovePrevious
    Wend
    objRS.MoveLast
    For intCounter = intNoOfRecords To intChosenRecord+1 Step -1
      strOutputString = strOutputString & "<TR>" & _
        "<TD>&nbsp;" & objRS("TitleID") & ": " & objRS("Director") & "</TD>" & _
        "<TD>" & objRS("Title") & "</TD>" & _
        "</TR>"
      objRS.MovePrevious
    Next
  End If
  strOutputString = strOutputString & "</TABLE>"
  objRS.Close
  Set objRS = Nothing
  Response.Write strOutputString
%>

<BR>
<FORM ACTION="Moving.asp" METHOD="POST">
  <H2>Format the list!</H2>
  Where do you want ths list to begin? Record
  <SELECT SIZE=1 NAME="ChosenRec">
  <%
    For intCounter=1 To intNoOfRecords
      Response.Write "<OPTION VALUE=" & intCounter & ">" & intCounter & "</OPTION>"
    Next
  %>
  </SELECT><BR><BR>
  Do you want the records to be listed
  in <INPUT TYPE="RADIO" NAME="Dir" VALUE="Forward" CHECKED><B> forward</B></INPUT>
  or <INPUT TYPE="RADIO" NAME="Dir" VALUE="Reverse"> <B>reverse</B></INPUT>
  order (select one)?
  <INPUT TYPE="SUBMIT" VALUE="View the list"></INPUT>
</FORM>
</BODY>
</HTML>
' My shortened version follows next
%
  Option Explicit
  Dim strConnect
%>


<HTML>
<HEAD>
<TITLE>Working your Way round a Recordset</TITLE>
</HEAD>
<BODY>

<%
  Dim intChosenRecord, strDirection, strOutputString, intCounter, intNoOfRecords
  If Request.Form("ChosenRec") <> "" Then
    intChosenRecord = Request.Form("ChosenRec")
    strDirection = Request.Form("Dir")
  Else
    intChosenRecord = 1
    strDirection = "Forward"
  End If

  Dim objRS
  Set objRS = Server.CreateObject("ADODB.Recordset")
  objRS.Open "Select * From AllMovies", strConnect, 3, 1
  intNoOfRecords = objRS.RecordCount
  objRS.Move intChosenRecord-1

  strOutputString = "<TABLE BORDER=1>" & _
                    "<TR><TD WIDTH=""30%""><B>Director</B></TD>" & _
                        "<TD><B>Film<B></TD></TR>"

  strOutputString = strOutputString & "</TABLE>"
    Response.Write "Number of Films :" & objRS.RecordCount 'Delete Table and loop prove mdb open and RS
  objRS.Close
  Set objRS = Nothing
  Response.Write strOutputString
%>

<BR>
<FORM ACTION="Moving.asp" METHOD="POST">
  <H2>Format the list!</H2>
  Where do you want ths list to begin? Record
  <SELECT SIZE=1 NAME="ChosenRec">
  <%
    For intCounter=1 To intNoOfRecords
      Response.Write "<OPTION VALUE=" & intCounter & ">" & intCounter & "</OPTION>"
    Next
  %>
  </SELECT><BR><BR>
  Do you want the records to be listed
  in <INPUT TYPE="RADIO" NAME="Dir" VALUE="Forward" CHECKED><B> forward</B></INPUT>
  or <INPUT TYPE="RADIO" NAME="Dir" VALUE="Reverse"> <B>reverse</B></INPUT>
  order (select one)?
  <INPUT TYPE="SUBMIT" VALUE="View the list"></INPUT>
</FORM>
</BODY>
</HTML>
  #4 (permalink)  
Old June 19th, 2004, 08:27 AM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

This looks like two separate ASP pages to me. Which one is causing the problem? Is the problem reproducible with a file from the code download?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: The Outlaw Torn by Metallica (Track 14 from the album: Load) What's This?
  #5 (permalink)  
Old June 19th, 2004, 09:16 AM
Authorized User
 
Join Date: Jun 2004
Location: Belfast, , United Kingdom.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, there are two seperate pages. The firstone is Movies.asp downloaded from Wrox which doesn't work for me. The second is an abridged version where I took out the looping and just did a simple Response.Write. This does work (but obviously only delivers a very limited output "Number of Files = 330") proving that that the Connection and RS are instantiated. So Why doesn't the main page work for me though it does for others?
  #6 (permalink)  
Old June 19th, 2004, 09:32 AM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Very odd. The page runs fine for me; both with the Access 2000 and the Access 97 database.

What OS are you running this on? Did you install recent ADO drivers?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Don't Cry (Alt. Lyrics) by Guns N' Roses (Track 12 from the album: Use Your Illusion 2) What's This?
  #7 (permalink)  
Old June 19th, 2004, 04:54 PM
Authorized User
 
Join Date: Jun 2004
Location: Belfast, , United Kingdom.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OS is Windows2000 Professional. ADO2.5 is installed as standard. Runing effectively as PWS Today I installed MDAC2.8 (the latest I think). Absolutely no difference. Does it suggest a problem with IIS or some form of memory leakage. As I said the problem is it works fine for a restricted record set. That is 295 records rather than 330. Just to be clear. If I delete 34 records from the AllMovies table everything works fine. Similarly if I reduce the record set from StaffTable to 295 (Just a random choice) it also works. So there appears to be no problem with the code, and no problem with database. So it must be IIS ability to store the information (machine has 512M RAM installed) prior to presenting it as HTML??? Perhaps... But then why does nobody else have this problem
  #8 (permalink)  
Old June 20th, 2004, 04:57 AM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi again,

What do you mean with "Running effectively as PWS"? You did install IIS, right?

Are you having problems with a specific record? That is, does it matter which records you delete? And can you define "masses of largely unintelligible gibberish"? How does your page look like?

Just as with your other issue: this shouldn't happen, but I am stumped as to why it does.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Paisley Park by Prince and the Revolution (Track 2 from the album: Around The World In A Day) What's This?
  #9 (permalink)  
Old June 20th, 2004, 09:49 AM
Authorized User
 
Join Date: Jun 2004
Location: Belfast, , United Kingdom.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, definately IIS 5.0 on local machine, Windows 2000 Professional, IE 6.0.2800. I have also downloaded the files unto my laptop which runs XP Pro, IIS 5.1 IE 6.0.2800 - Everything worked fine - No problems. I copied this database to the local machine - problems return. I then tried to open the files using Opera - Same problem as explorer. So it would appear to be a local machine or IIS 5.0 issue.

I attach the first page of the screen dump to explain the gibberish

HTTP/1.1 200 OK Server: Microsoft-IIS/5.0 Date: Sun, 20 Jun 2004 13:40:45 GMT Content-Length: 35032 Content-Type: text/html Cache-control: private RABQT=FGPNNDBCKKLHOLCPOBOLPBNJ; path=/ Cache-control: private COPY, MOVE, MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, SEARCH Allow: OPTIONS, TRACE, GET, HEAD, COPY, PROPFIND, SEARCH, LOCK, UNLOCK Cache-Control: private ! ,C:\WINNT\system32\inetsrv\asp.dll,1,GET,HEAD,POST ,TRACE.cer,C:\WINNT\system32\inetsrv\asp.dll,1,GET ,HEAD,POST,TRACE.cdx,C:\WINNT\system32\inetsrv\asp .dll,1,GET,HEAD,POST,TRACE.asa,C:\WINNT\system32\i netsrv\asp.dll,1,GET,HEAD,POST,TRACE.htr\system3 ! sr B Ô´lnguage+ d ATQC XñpmtDDèB PñpmGðe ) & xÔ d €8¾´@ Ť€s yÒ ‹× ÜÂú µ M+ ð~µ,C:\WINNT\system32\inetsrv\asp.dll,1GET,HEAD, POST,TRACE.cer,C:\WINNT\system32\inetsrv\asp.dll,1 GET,HEAD,POST,TRACE.cdx,C:\WINNT\system32\inetsrv\ asp.dll,1GET,HEAD,POST,TRACE.asa,C:\WINNT\system32 \inetsrv\asp.dll,1GET,HEAD,POST,TRACE.htr,C:\WINNT \system32\inetsrv\asp.dll,1GET,POST.idc,C:\WINNT\s ystem32\inetsrv\httpodbc.dll,1OPTIONS,GET,HEAD,POS T,PUT,DELETE,TRACE.shtm,C:\WINNT\system32\inetsrv\ ssinc.dll,1GET,POST.shtml,C:\WINNT\system32\inetsr v\ssinc.dll,1GET,POST.stm,C:\WINNT\system32\inetsr v\ssinc.dll,1GET,POST.printer,C:\WINNT\system32\ms w3prt.dll,1GET,POST)M ,C:\WINNT\system32\inetsrv\asp.dll,1,GET,HEAD,POST ,TRACE.cer,C:\WINNT\system32\inetsrv\asp.dll,1,GET ,HEAD,POST,TRACE.cdx,C:\WINNT\system32\inetsrv\asp .dll,1,GET,HEAD,POST,TRACE.asa,C:\WINNT\system32\i netsrv\asp.dll,1,GET,HEAD,POST,TRACE.htr,C:\WINNT\ system32\inetsrv\asp.dll,1,GET,POST.idc ) C:\Inetpub\wwwroot\BegASPFiles\Moving.aspp+ ATQC ˆñpmDÖ´èB €ñpmGðe , ' ¨ €8¾´@ Ť€s yÒ ‹× ÜÂú à µ Æ+ GET/BegASP/StaffTable.aspHTTP/1.1 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */* Referer: http://joan/BegASP/InteractiveDirectory.asp Accept-Language: en-gb Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; DIL0001021; .NET CLR 1.1.4322) Host: joan Connection: Keep-Alive Cookie: SavedLogin=pw=&email=basil; ASPSESSIONIDQSARABQT=AGPNNDBCENMPMNCIGNDCHHHM HHM Æ :\Inetpub\wwwroot\BegASPFiles\StaffTable.asprt.asp :\WINNT\system32\inetsrv\asp.dll, ÁCa$ ¥ ¥ ¥ ¥ `ï®ÿÿÿÿ ØZ ˜8µ+ *èÿ´" !ˆnµS Q _BKavedLogin=pw=&email=basil Id µ , BegASP/InteractiveDirectory.asp /BEGASP/MOVING.ASPP ˜ B˜ B BegASP/ExpertMoving.asp.aspsp BegASP/ExpertMoving.asp.aspsp BegASP/ExpertMoving.asp.aspsp à µ €BLOB ŸIðe° µ ÿÿÿÿ )PT ØÜ® É 400,*,FILE,C:\WINNT\help\iisHelp\common\400.htm401 ,1,FILE,C:\WINNT\help\iisHelp\common\401-1.htm401,2,FILE,C:\WINNT\help\iisHelp\common\401-2.htm401,3,FILE,C:\WINNT\help\iisHelp\common\401-3.htm401,4,FILE,C:\WINNT\help\iisHelp\common\401-4.htm401,5,FILE,C:\WINNT\help\iisHelp\common\401-5.htm403,1,FILE,C:\WINNT\help\iisHelp\common\403-1.htm403,2,FILE,C:\WINNT\help\iisHelp\common\403-2.htm403,3,FILE,C:\WINNT\help\iisHelp\common\403-3.htm403,4,FILE,C:\WINNT\help\iisHelp\common\403-4.htm403,5,FILE,C:\WINNT\help\iisHelp\common\403-
  #10 (permalink)  
Old June 21st, 2004, 04:13 AM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Wow, this *is* gibberish..... And indeed it looks like an IIS issue.

Did you try to reinstall IIS? Do you have any blocking software, like URL Scan or firewall software on the Windows 2000 machine?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Something you got by Jimi Hendrix (Track 4 from the album: Purple Haze) What's This?
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal report binding with large data set, error lankark Crystal Reports 0 April 3rd, 2008 09:16 AM
variable is not set (chapter 13) mcandw BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 3 August 20th, 2004 06:13 PM
Beginning ASP3.0 chapter 13 - large record set cau BasilKBL ASP.NET 1.0 and 1.1 Basics 2 June 18th, 2004 01:35 PM



All times are GMT -4. The time now is 09:02 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.