*Fixed* Thanks! Alex Elger Micronage Ltd [EMAIL PROTECTED]
-----Original Message----- From: Ben Timby [mailto:[EMAIL PROTECTED]] Sent: 27 August 2002 7:08 PM To: ActiveServerPages Subject: RE: This array is fixed or temporarily locked -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Actually, I get this error when doing something like the following: arrArray = arrArray(0,1) You have to do: arrTemp = arrArray(0,1) arrArray = arrTemp You are doing something similar above the line you tagged. Good luck! Ben Timby Webexcellence PH: 317.423.3548 x23 TF: 800.808.6332 x23 FX: 317.423.8735 [EMAIL PROTECTED] www.webexc.com - - -----Original Message----- From: Alex Elger [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 27, 2002 8:17 AM To: ActiveServerPages Subject: RE: This array is fixed or temporarily locked As requested the code. The problem is at the end as indicated. <% @LANGUAGE = VBSCRIPT %> <%option explicit%> <%response.buffer=true%> <!-- #INCLUDE FILE="../db/adovbs.inc" --> <!-- #INCLUDE FILE="../db/connection.asp" --> <% 'LOCAL VARIABLES dim objCon ' Connection object dim objCommand ' Command object dim objRS ' Recordset object dim intRows ' Number of matches found dim intGroup ' Group dim blnGotRows ' Flag indicating if anything was found dim strRecordArray ' Array for holding Records dim strRecordArrayHolDays ' Array for holding Main Records dim strUserNameArray dim intMaxCount ' Upper bound for loop dim intCounter ' Loop counter dim intMaxCountb ' Upper bound for loop dim intCounterb ' Loop counter dim hidGroup dim tempvar dim txtSQL dim Catagory dim txtOderBy dim UserName dim strRecordArrayToday dim strRecordArrayMin1 UserName = Request.Cookies("Micronage")("UserName") ' FIRSTLY CHECK THE DATABASE FOR MATCHING DATA AND REDIRECT TO a "No Matches" PAGE IF NONE FOUND ' Create Connection Set objCon = Server.CreateObject( "ADODB.Connection" ) objCon.Open strConnection txtSQL = "SELECT DISTINCT SPECIFICCODE from timesheet where TO_CHAR(TSDATE, 'MM/YYYY') = TO_CHAR(SYSDATE, 'MM/YYYY') and UserName = '" + UserName + "'" ' Define Command object Set objCommand = Server.CreateObject( "ADODB.Command" ) Set objCommand.ActiveConnection = objCon 'objCommand.CommandType = adcmdStoredProc objCommand.CommandText = txtSQL ' Execute the Command object and store the return code objCommand.Execute ' Create the Recordset set objRS = Server.CreateObject( "ADODB.Recordset" ) objRS.CursorType = adOpenForwardOnly objRS.LockType = adLockReadOnly objRS.Open objCommand ' Immediately Clear the command object set objCommand = nothing ' Are then any Rows returned ? if objRS.EOF then blnGotRows = False else strRecordArray = objRS.Getrows blnGotRows = True end if ' Housekeeping objRS.close set objRS = nothing If blnGotRows = False then Response.Redirect "../main/nomatches.htm" %> <html> <head> <title>Weekly Timesheet View</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> <table width="90%" border="1" cellspacing="1" cellpadding="4" align="center"> <tr> <td bgcolor="#999999"> <div align="center"><font face="Verdana" color="#FFFFFF">Time sheet for the last 5 days</font></div> </td> </tr> <tr> <td height="73" bgcolor="3399FF"> <table width="100%" border="0" cellspacing="1" cellpadding="4" height="56" align="center"> <tr> <td width="11%"> <div align="center"><font color="#000000" face="Verdana">Project</font></div> </td> <td width="13%"> <div align="center"> <%Response.Write DateAdd("d", -4, Date())%> </div> </td> <td width="11%"> <div align="center"> <%Response.Write DateAdd("d", -3, Date())%> </div> </td> <td width="15%"> <div align="center"> <%Response.Write DateAdd("d", -2, Date())%> </div> </td> <td width="17%"> <div align="center"> <%Response.Write DateAdd("d", -1, Date())%> </div> </td> <td width="17%"> <div align="center"> <%Response.Write Date()%> </div> </td> <td width="16%"><font face="Verdana">Totals</font></td> </tr> <% ' Loop around filling the table intMaxCount = ubound(strRecordArray,2) For intCounter = 0 to intMaxCount %> <tr> <td width="11%"> <div align="center"><font color="#0000FF"><font face="Verdana"> <%Response.Write strRecordArray(0,intCounter)%> </font></font></div> </td> <td width="13%"> <div align="center"><font color="#0000FF"><font face="Verdana"> <% txtSQL = "SELECT HoursSpent from timesheet where TO_CHAR(TSDATE, 'DD/MM/YYYY') = TO_CHAR(SYSDATE-1, 'DD/MM/YYYY') and UserName = '" + UserName + "' and SPECIFICCODE = '" + strRecordArray(0,intCounter) + "'" ' FIRSTLY CHECK THE DATABASE FOR MATCHING DATA AND REDIRECT TO a "No Matches" PAGE IF NONE FOUND ' Create Connection Set objCon = Server.CreateObject( "ADODB.Connection" ) objCon.Open strConnection ' Define Command object Set objCommand = Server.CreateObject( "ADODB.Command" ) Set objCommand.ActiveConnection = objCon 'objCommand.CommandType = adcmdStoredProc objCommand.CommandText = txtSQL ' Execute the Command object and store the return code objCommand.Execute ' Create the Recordset set objRS = Server.CreateObject( "ADODB.Recordset" ) objRS.CursorType = adOpenForwardOnly objRS.LockType = adLockReadOnly objRS.Open objCommand ' Immediately Clear the command object set objCommand = nothing ' Are then any Rows returned ? if objRS.EOF then blnGotRows = False else strRecordArrayMin4 = objRS.Getrows blnGotRows = True end if ' Housekeeping objRS.close set objRS = nothing %> <%if blnGotRows = true then Response.Write strRecordArrayMin4(0,0) else response.write "0" end if%> </font></font></div> </td> <td width="11%"> <div align="center"><font color="#0000FF"><font face="Verdana"> <% txtSQL = "SELECT HoursSpent from timesheet where TO_CHAR(TSDATE, 'DD/MM/YYYY') = TO_CHAR(SYSDATE-1, 'DD/MM/YYYY') and UserName = '" + UserName + "' and SPECIFICCODE = '" + strRecordArray(0,intCounter) + "'" ' FIRSTLY CHECK THE DATABASE FOR MATCHING DATA AND REDIRECT TO a "No Matches" PAGE IF NONE FOUND ' Create Connection Set objCon = Server.CreateObject( "ADODB.Connection" ) objCon.Open strConnection ' Define Command object Set objCommand = Server.CreateObject( "ADODB.Command" ) Set objCommand.ActiveConnection = objCon 'objCommand.CommandType = adcmdStoredProc objCommand.CommandText = txtSQL ' Execute the Command object and store the return code objCommand.Execute ' Create the Recordset set objRS = Server.CreateObject( "ADODB.Recordset" ) objRS.CursorType = adOpenForwardOnly objRS.LockType = adLockReadOnly objRS.Open objCommand ' Immediately Clear the command object set objCommand = nothing ' Are then any Rows returned ? if objRS.EOF then blnGotRows = False else strRecordArrayMin3 = objRS.Getrows blnGotRows = True end if ' Housekeeping objRS.close set objRS = nothing %> <%if blnGotRows = true then Response.Write strRecordArrayMin3(0,0) else response.write "0" end if%> </font></font></div> </td> <td width="15%"> <div align="center"><font color="#0000FF"><font face="Verdana"> <% txtSQL = "SELECT HoursSpent from timesheet where TO_CHAR(TSDATE, 'DD/MM/YYYY') = TO_CHAR(SYSDATE-1, 'DD/MM/YYYY') and UserName = '" + UserName + "' and SPECIFICCODE = '" + strRecordArray(0,intCounter) + "'" ' FIRSTLY CHECK THE DATABASE FOR MATCHING DATA AND REDIRECT TO a "No Matches" PAGE IF NONE FOUND ' Create Connection Set objCon = Server.CreateObject( "ADODB.Connection" ) objCon.Open strConnection ' Define Command object Set objCommand = Server.CreateObject( "ADODB.Command" ) Set objCommand.ActiveConnection = objCon 'objCommand.CommandType = adcmdStoredProc objCommand.CommandText = txtSQL ' Execute the Command object and store the return code objCommand.Execute ' Create the Recordset set objRS = Server.CreateObject( "ADODB.Recordset" ) objRS.CursorType = adOpenForwardOnly objRS.LockType = adLockReadOnly objRS.Open objCommand ' Immediately Clear the command object set objCommand = nothing ' Are then any Rows returned ? if objRS.EOF then blnGotRows = False else strRecordArrayMin2 = objRS.Getrows blnGotRows = True end if ' Housekeeping objRS.close set objRS = nothing %> <%if blnGotRows = true then Response.Write strRecordArrayMin2(0,0) else response.write "0" end if%> </font></font></div> </td> <td width="17%"> <div align="center"><font color="#0000FF"><font face="Verdana"> <% txtSQL = "SELECT HoursSpent from timesheet where TO_CHAR(TSDATE, 'DD/MM/YYYY') = TO_CHAR(SYSDATE-1, 'DD/MM/YYYY') and UserName = '" + UserName + "' and SPECIFICCODE = '" + strRecordArray(0,intCounter) + "'" ' FIRSTLY CHECK THE DATABASE FOR MATCHING DATA AND REDIRECT TO a "No Matches" PAGE IF NONE FOUND ' Create Connection Set objCon = Server.CreateObject( "ADODB.Connection" ) objCon.Open strConnection ' Define Command object Set objCommand = Server.CreateObject( "ADODB.Command" ) Set objCommand.ActiveConnection = objCon 'objCommand.CommandType = adcmdStoredProc objCommand.CommandText = txtSQL ' Execute the Command object and store the return code objCommand.Execute ' Create the Recordset set objRS = Server.CreateObject( "ADODB.Recordset" ) objRS.CursorType = adOpenForwardOnly objRS.LockType = adLockReadOnly objRS.Open objCommand ' Immediately Clear the command object set objCommand = nothing ' Are then any Rows returned ? if objRS.EOF then blnGotRows = False else strRecordArrayMin1 = objRS.Getrows blnGotRows = True end if ' Housekeeping objRS.close set objRS = nothing %> <%if blnGotRows = true then Response.Write strRecordArrayMin1(0,0) else response.write "0" end if%> </font></font></div> </td> <td width="17%"> <div align="center"><font color="#0000FF"><font face="Verdana"> <% txtSQL = "SELECT HoursSpent from timesheet where TO_CHAR(TSDATE, 'DD/MM/YYYY') = TO_CHAR(SYSDATE, 'DD/MM/YYYY') and UserName = '" + UserName + "' and SPECIFICCODE = '" + strRecordArray(0,intCounter) + "'" ' FIRSTLY CHECK THE DATABASE FOR MATCHING DATA AND REDIRECT TO a "No Matches" PAGE IF NONE FOUND ' Create Connection Set objCon = Server.CreateObject( "ADODB.Connection" ) objCon.Open strConnection ' Define Command object Set objCommand = Server.CreateObject( "ADODB.Command" ) Set objCommand.ActiveConnection = objCon 'objCommand.CommandType = adcmdStoredProc objCommand.CommandText = txtSQL ' Execute the Command object and store the return code objCommand.Execute ' Create the Recordset set objRS = Server.CreateObject( "ADODB.Recordset" ) objRS.CursorType = adOpenForwardOnly objRS.LockType = adLockReadOnly objRS.Open objCommand ' Immediately Clear the command object set objCommand = nothing ' Are then any Rows returned ? if objRS.EOF then blnGotRows = False strRecordArrayToday = "0" else strRecordArrayToday = objRS.Getrows strRecordArrayToday = strRecordArrayToday(0,0) (Problem lies here on the second loop) blnGotRows = True end if ' Housekeeping objRS.close set objRS = nothing %><%Response.Write strRecordArrayToday%></font></font></div> </td> <td width="16%"><font color="#0000FF" face="Verdana"><%Response.Write strRecordArrayToday%></font></td> <%set strRecordArrayToday = nothing%> </tr> <%Next%> </table> </td> </tr> </table> </body> </html> Alex Elger Micronage Ltd [EMAIL PROTECTED] - - -----Original Message----- From: Chris Janz [mailto:[EMAIL PROTECTED]] Sent: 27 August 2002 3:50 PM To: ActiveServerPages Subject: RE: This array is fixed or temporarily locked is this array recursive? some code might help? - - -----Original Message----- From: Alex Elger [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 27, 2002 10:50 AM To: ActiveServerPages Subject: This array is fixed or temporarily locked I am using a array that is in a loop. On the second loop i get : Microsoft VBScript runtime error '800a000a' This array is fixed or temporarily locked How do i clear an array once i have used it? I have tried: set strRecordArrayToday = nothing but to no avail Thanks for your advance help Alex - - --- You are currently subscribed to activeserverpages as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% - - --- You are currently subscribed to activeserverpages as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% - - --- You are currently subscribed to activeserverpages as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% -----BEGIN PGP SIGNATURE----- Version: PGP 7.0.4 iQA/AwUBPWu/8vnby1cCm2Q8EQJKPQCgpMRxRztfFjc5ppkQGEcAJtMxZKQAoOk0 ZUWQFf29VyNSk7JEEFRV/a/v =UYYT -----END PGP SIGNATURE----- --- You are currently subscribed to activeserverpages as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% --- You are currently subscribed to activeserverpages as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED]
