Do While Not objRs.EOF
if objRS("Username")=strUsername Then
Response.redirect "exists.htm"
Elseif objRS("AccCode")= strAccCode then
Response.redirect "exists.htm"
Elseif objRS("EmailAddress")=strEmail then
Response.redirect "exists.htm"
End if
objRS.MoveNext
Loop
Select Case a
Case "A": ' Add
' Open record
strsql = "SELECT * FROM [tblUsers] WHERE 0 = 1"
set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strsql, conn, 1, 2
rs.AddNew
tmpFld = Trim(x_Username)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("Username") = tmpFld
tmpFld = Trim(x_AccCode)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("AccCode") = tmpFld
tmpFld = Trim(x_FirstName)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("FirstName") = tmpFld
tmpFld = Trim(x_Surname)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("Surname") = tmpFld
tmpFld = Trim(x_School)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("School") = tmpFld
tmpFld = Trim(x_Grade)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("Grade") = tmpFld
tmpFld = Trim(x_EmailAddress)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("EmailAddress") = tmpFld
tmpFld = Trim(x_AccessLevel)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("AccessLevel") = tmpFld
tmpFld = x_Date
If IsDate(tmpFld) Then
rs("Date") = cDate(tmpFld)
Else
rs("Date") = Null
End If
tmpFld = x_ExpiryDate
If IsDate(tmpFld) Then
rs("ExpiryDate") = cDate(tmpFld)
Else
rs("ExpiryDate") = Null
End If
rs.Update
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
Response.Clear
Response.Redirect "successreg.htm"
End Select
Response.End
end if
rsAccCode.MoveNext
loop
Response.redirect "exists.htm"
</CODE>
My problem is that the code wont run , because it goes directly to the 'Response.redirect "exists.htm"' , please can someone help me ive tried everything .
Do While Not objRs.EOF
if objRS("Username")=strUsername Then
Response.redirect "exists.htm"
Elseif objRS("AccCode")= strAccCode then
Response.redirect "exists.htm"
Elseif objRS("EmailAddress")=strEmail then
Response.redirect "exists.htm"
End if
objRS.MoveNext
Loop
I'm sorry if my short answers seem rude, but I just don't have enough information to give you more than that. And my response this time is: then what is the last redirect there for?
Bookmarks