AllenRitch
Technical User
Below is the code I am using and the include statement contains both the database & recordset createobject statements (among other things). I recieve no erros, and everything works except for the response.redirect statements found near the bottom just befor the VBScript Error Checker. Why not? Thanks...
<%@ LANGUAGE="VBSCRIPT" %>
<!-- Make Data Connection -->
<!--#include file=includes\DataConn.inc -->
<%
On Error Resume Next
' Declare User & General Variables
Dim UserAlias, ReturnCode, UserFound
' Get User's Alias
UserAlias = Right(request.ServerVariables("logon_user"
,4)
ReturnCode = Len(UserAlias)
' Validate & Check the Alias against the database for further processing.
If ReturnCode<>4 Then
' Invalid Alias
response.redirect "error.htm"
Else
' Valid Alias; See if Alias already exists in table.
SQLString = "SELECT * FROM [tblAlias] WHERE user_alias='" & UserAlias & "';"
RDSet.Open SQLString, DBConn
If RDSet.EOF Then
' Alias doesn't exist
UserFound = "False"
Else
' Alias does exist
UserFound = "True"
End If
' Close Record Set
RDSet.Close
Set RDSet = Nothing
End If
' Check for Database Errors before closing
If DBConn.Errors.Count>0 Then
response.write "Database Errors Occured" & "<br>"
response.write SQLString & "<br>"
For each error in DBConn.Errors
response.write(Error.Number & " : " & Error.Description) & "<p>"
Next
End If
' Close Database
DBConn.Close
Set DBConn = Nothing
' Redirect User Depending on Search Outcome
If UserFound="False" Then
response.redirect "survy_grp.htm"
Else
response.redirect "restricted.htm"
End If
' Check for VBScript Errors
If err.number>0 Then
response.write "VBScript Errors Occured:" & "<br>"
response.write "Error Number = " & err.number & "<br>"
response.write "Error Descr. = " & err.description & "<br>"
response.write "Help Context = " & err.helpcontext & "<br>"
response.write "Help File = " & err.helpfile & "<br>"
response.write "Source = " & err.source & "<p>"
End If
%>
<%@ LANGUAGE="VBSCRIPT" %>
<!-- Make Data Connection -->
<!--#include file=includes\DataConn.inc -->
<%
On Error Resume Next
' Declare User & General Variables
Dim UserAlias, ReturnCode, UserFound
' Get User's Alias
UserAlias = Right(request.ServerVariables("logon_user"
ReturnCode = Len(UserAlias)
' Validate & Check the Alias against the database for further processing.
If ReturnCode<>4 Then
' Invalid Alias
response.redirect "error.htm"
Else
' Valid Alias; See if Alias already exists in table.
SQLString = "SELECT * FROM [tblAlias] WHERE user_alias='" & UserAlias & "';"
RDSet.Open SQLString, DBConn
If RDSet.EOF Then
' Alias doesn't exist
UserFound = "False"
Else
' Alias does exist
UserFound = "True"
End If
' Close Record Set
RDSet.Close
Set RDSet = Nothing
End If
' Check for Database Errors before closing
If DBConn.Errors.Count>0 Then
response.write "Database Errors Occured" & "<br>"
response.write SQLString & "<br>"
For each error in DBConn.Errors
response.write(Error.Number & " : " & Error.Description) & "<p>"
Next
End If
' Close Database
DBConn.Close
Set DBConn = Nothing
' Redirect User Depending on Search Outcome
If UserFound="False" Then
response.redirect "survy_grp.htm"
Else
response.redirect "restricted.htm"
End If
' Check for VBScript Errors
If err.number>0 Then
response.write "VBScript Errors Occured:" & "<br>"
response.write "Error Number = " & err.number & "<br>"
response.write "Error Descr. = " & err.description & "<br>"
response.write "Help Context = " & err.helpcontext & "<br>"
response.write "Help File = " & err.helpfile & "<br>"
response.write "Source = " & err.source & "<p>"
End If
%>