parallon
08-10-2006, 09:54 PM
Hello all. I have a script that works fine until I give it a condition, then I get the following error:
Microsoft VBScript runtime error '800a01a8'
Object required: ''
/Project/project.asp, line 604
Where line 604 is: Set rsConflict = Nothing
Here is the code, and as soon as I insert the IF and END IF, I get that error (as long as the condition is true).
<%
Dim PhaseAdd
Dim rsConflict
Dim rsConflict_numRows
PhaseAdd = ""
PhaseAdd = Request.QueryString("PhaseAdd")
IF PhaseAdd <> "True" THEN
Set rsConflict = Server.CreateObject("ADODB.Recordset")
rsConflict.ActiveConnection = MM_Tero_Roports_STRING
rsConflict.Source = "SELECT ProjectId, Status, Division, StartDate, EndDate FROM Projects WHERE ((StartDate BETWEEN '" & Start_Date & "' AND '" & End_Date & "' OR EndDate BETWEEN '" & Start_Date & "' AND '" & End_Date & "') OR ('" & Start_Date & "' BETWEEN StartDate AND EndDate OR '" & End_Date & "' BETWEEN StartDate AND EndDate) ) AND (Status <> 'Close' AND Status <> 'COMPLETED' AND Status <> 'Canc')AND Division = '3.VQ.DADA.PM'"
rsConflict.CursorType = 0
rsConflict.CursorLocation = 2
rsConflict.LockType = 1
rsConflict.Open()
rsConflict_numRows = 0
dim PrjID
PrjID=""
while not rsConflict.EOF
PrjID = PrjID & rsConflict("ProjectId") & "\n"
rsConflict.movenext
wend
%>
<script TYPE="text/javascript">
{
var duplicates = "<%=PrjID%>";
if (duplicates) {
alert ("The Project that you are adding has a Start Date and/or End Date within the \n\nStart and End Dates of the following 'OPEN' projects within your division: \n\n" + duplicates);
}
}
</script>
<% End If %>
Here is where the querystring is getting populated:
Response.Write "<SCRIPT LANGUAGE=""JAVASCRIPT"">" & chr(10)
Response.Write "opener.parent.main.document.location.href='project.asp?projectid=" & projectId1 & "&autonum=4&PhaseAdd=True';"
Response.Write "window.close();"
Response.Write "</script>"
Any suggestions would be greatly appreciated.
Thanks,
Parallon
Microsoft VBScript runtime error '800a01a8'
Object required: ''
/Project/project.asp, line 604
Where line 604 is: Set rsConflict = Nothing
Here is the code, and as soon as I insert the IF and END IF, I get that error (as long as the condition is true).
<%
Dim PhaseAdd
Dim rsConflict
Dim rsConflict_numRows
PhaseAdd = ""
PhaseAdd = Request.QueryString("PhaseAdd")
IF PhaseAdd <> "True" THEN
Set rsConflict = Server.CreateObject("ADODB.Recordset")
rsConflict.ActiveConnection = MM_Tero_Roports_STRING
rsConflict.Source = "SELECT ProjectId, Status, Division, StartDate, EndDate FROM Projects WHERE ((StartDate BETWEEN '" & Start_Date & "' AND '" & End_Date & "' OR EndDate BETWEEN '" & Start_Date & "' AND '" & End_Date & "') OR ('" & Start_Date & "' BETWEEN StartDate AND EndDate OR '" & End_Date & "' BETWEEN StartDate AND EndDate) ) AND (Status <> 'Close' AND Status <> 'COMPLETED' AND Status <> 'Canc')AND Division = '3.VQ.DADA.PM'"
rsConflict.CursorType = 0
rsConflict.CursorLocation = 2
rsConflict.LockType = 1
rsConflict.Open()
rsConflict_numRows = 0
dim PrjID
PrjID=""
while not rsConflict.EOF
PrjID = PrjID & rsConflict("ProjectId") & "\n"
rsConflict.movenext
wend
%>
<script TYPE="text/javascript">
{
var duplicates = "<%=PrjID%>";
if (duplicates) {
alert ("The Project that you are adding has a Start Date and/or End Date within the \n\nStart and End Dates of the following 'OPEN' projects within your division: \n\n" + duplicates);
}
}
</script>
<% End If %>
Here is where the querystring is getting populated:
Response.Write "<SCRIPT LANGUAGE=""JAVASCRIPT"">" & chr(10)
Response.Write "opener.parent.main.document.location.href='project.asp?projectid=" & projectId1 & "&autonum=4&PhaseAdd=True';"
Response.Write "window.close();"
Response.Write "</script>"
Any suggestions would be greatly appreciated.
Thanks,
Parallon