|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 %> |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
Yep, that was the problem, thanks a mill,
coconol |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > ASP - Out of memory - Problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|