JohnnyPolite
MIS
Hello all,
I keep getting a message saying that I am passing the wrong amount of arguments or have invalid properties. COuld someone please look at this code and tell me what I have done wrong? It looks good to me, but that is probably a large amount of the reason why I can't find the error.
This is driving me nuts! I am fairly new at vbscript and have only written very very simple functions before.
I appreciate all the help I can get. Thanks so much!!!
-JP
I keep getting a message saying that I am passing the wrong amount of arguments or have invalid properties. COuld someone please look at this code and tell me what I have done wrong? It looks good to me, but that is probably a large amount of the reason why I can't find the error.
Code:
<%
ErrorFound = False
strSQL = "UPDATE tblStudentContacts SET "
Function StrBuild(FieldName)
if(Request.Form(FieldName) <> "") then
VarName = Request.Form(FieldName)
strBuild = FieldName + " = '" + Replace(VarName, "'", "''") + "', "
EXIT FUNCTION
END IF
'Check to make sure parent is legal guardian
Parent = Left(FieldName, 3)
If Request.Form(Parent & "Guard") = "Yes" Then
'Check to see if field is a phone number or email
If FieldName <> Parent & "HomePh" OR FieldName <> Parent & "WorkPh" OR FieldName <> Parent & "CellPh" OR FieldName <> Parent & "Email" THEN
strBuild = "^ERROR^"
EXIT FUNCTION
End IF
End IF
strBuild = "MoveOn"
End Function
rsFldName.MoveFirst
While NOT rsFldName.EOF
FieldName = rsFldName.fields.item("Parents").value
StrBuild(FieldName)
If StrBuild = "^ERROR^" THEN
ErrorFound = True
End If
If StrBuild <> "^ERROR^" or StrBuild <> "MoveOn" Then
StrSQL = StrSQL & StrBuild
End If
rsFldName.MoveNext
Wend
'close out the rs
rsFldName.Close()
Set rsFldName = Nothing
'Trim of the Comma Space
StrLen = Len(StrSQL) - 2
StrSQL = Left(StrSQL, StrLen)
StrSQL = StrSQL & "WHERE StuID = " & Request.Form("StuID") & ";"
This is driving me nuts! I am fairly new at vbscript and have only written very very simple functions before.
I appreciate all the help I can get. Thanks so much!!!
-JP