SunQuest
           ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old August 28th, 2003, 12:09 PM
coconol coconol is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 6 coconol User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 40 sec
Reputation Power: 0
ASP - Out of memory - Problem

Hey Im having a problem with this webpage, getting

Microsoft VBScript runtime error '800a0007'
out of memory

The code includes a webgannt.asp and should work code below is sample code from the web. Have u any idea what is going wrong? I'm fairly new to ASP and havent seen this error before. ive marked line 108 FYI




dim tempstr
dim strconn
dim cn1
dim sServer
dim sUID
dim sPWD
dim pver
dim drver
dim bgval
dim pristr
dim bakstr
dim m1
dim m2
dim m,HeadMonth,PrevMonthSupp
dim maxRdate


'Get the form values
'm = Request.Form ("cbomonth")


sServer = "servername"
sUID= "username"
sPWD= "password"
set cn1= createobject("ADODB.Connection")
cn1.ConnectionTimeout = 100
strconn = "SERVER=" + sServer + ";DRIVER={SQL Server};UID=" + sUID + ";PWD=" + sPWD + ";"
cn1.Open strconn
cn1.DefaultDatabase = "dbsProjectControl"



Set rs = Server.CreateObject("ADODB.Recordset")
Dim tasks (),idx
pristr = "SELECT * FROM tblTask WHERE ProjectID = 1"
rs.Open pristr, cn1
ReDim tasks(rs.RecordCount - 1, 6) '--------------- line 108
While Not rs.EOF
tasks(rs.AbsolutePosition - 1, 0) = rs("TaskID")
tasks(rs.AbsolutePosition - 1, 1) = rs("TaskNM")
tasks(rs.AbsolutePosition - 1, 2) = rs("PlanStartDT")
tasks(rs.AbsolutePosition - 1, 3) = rs("PlanEndDT")
tasks(rs.AbsolutePosition - 1, 4) = rs("ActStartDT")
tasks(rs.AbsolutePosition - 1, 5) = rs("ActEndDT")
tasks(rs.AbsolutePosition - 1, 6) = rs("PctCompleteQY")
rs.MoveNext
Wend
rs.Close
Set rs = Nothing ' Always "kill" your recordset before ending the page!
wgChartMonths = 6
wgStartMonth = 4
wgStartYear = 2002
wgCellSize = 5
wgDateFormat = "M/D/Y"
wgDataArray = tasks
wgPlannedColor = "008080"
wgActualColor = "800080"
wgHeaderFontName = "Times New Roman"
wgHeaderFontSize = 8
wgHeaderFontColor = "#FFFFFF"
wgHeaderFontBold = True
wgHeaderFontItalic = True
wgTaskFontName = "Tahoma"
wgTaskFontSize = 8
wgTaskFontColor = "#000080"
wgTaskFontBold = False
wgTaskFontItalic = True
wgHeaderBgColor = "000080"
wgTaskBgColor = "FFFFFF"
wgBorderColor = "808080"
wgColumnWidth(0) = 20
wgColumnWidth(1) = 100
wgColumnWidth(2) = 60
wgColumnWidth(3) = 60
wgColumnWidth(4) = 80 ' Setting to zero hides a column
wgColumnWidth(5) = 80 ' Setting to zero hides a column
wgRowsPerChart = 10
wgRegisterKey = "111-XXX-222"
Response.Write MakeChart %>

Reply With Quote
  #2  
Old August 28th, 2003, 01:00 PM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
You need to debug your code...


Here...I wouldn't be surprise if the value of your rs.RecordCount is equal to -1

So that line--> ReDim tasks(rs.RecordCount - 1, 6)

Would in fact read --> ReDim tasks(-1- 1, 6)

Which would then read --> ReDim tasks(-2, 6)

***************DEBUG DEBUG DEBUG DEBUG**************

Is the way to go, here add some debugging techniques such as:

pristr = "SELECT * FROM tblTask WHERE ProjectID = 1"
rs.Open pristr, cn1

'FOR DEBUG ONLY
Response.Write "-->" & rs.RecordCount & "<--<hr>"
Response.End


Oh and if it does return -1 then read this...
http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=139


Hope this helps!
Sincerely

Vlince

Reply With Quote
  #3  
Old August 28th, 2003, 01:06 PM
coconol coconol is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 6 coconol User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 40 sec
Reputation Power: 0
Yep, that was the problem, thanks a mill,
coconol

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > ASP - Out of memory - Problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway