M
middletree
I am doing an Intranet-based app. For one set of pages on the app, I want to
grab the user's network logon ID. I have chosen to do this with this code:
----------------------------------------------------------------------------
strLogon= Request.ServerVariables("LOGON_USER")
Set RS = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT EmployeeID, DepartmentID "
strSQL = strSQL & "FROM Employee "
strSQL = strSQL & "WHERE NetworkID = '"&strLogon&"'"
RS.Open strSQL, objConnection
'this is to pass the value of the name of the TSE to the next page
Response.Cookies("TSE_ID") = rs("EmployeeID")
strDepartmentID = rs("DepartmentID")
rs.Close
Set rs = Nothing
If strDepartmentID = "9" then
Response.Redirect("DisplayOpenTicketsTSE.asp")
Else
Response.Redirect("DisplayOpenTickets.asp")
end if
----------------------------------------------------------------------------
----
In production, this works just fine. If you happen to be in the tech support
department, (9), it takes you to a page which shows you just your open
tickets, and if not, it takes you to a page which displays all open tickets.
I decided to create a development environment for this app, which I should
have done in the first place, and so I copied the SQL Server 2K database,
then copied the asp code down into my wwwroot directory. The pages which
don't have the cookie code work just fine, but the ones that do have cookie
stuff do not work. These are just browser cookies, and their only purpose is
to get the Windows logon name, nothing else. I have no experience with any
cookies prior to this.
Here's the error message I get:
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'RS(...).Cookies'
/displayopenredirect.asp, line 17
where line 17 is the one in the middle of the above code:
Response.Cookies("TSE_ID") = rs("EmployeeID")
I'm having a hard time understanding why this work in prod, but not in my
dev environment. The dev environment is on the network, so it should be able
to grab my logon name exactly as it does when running from the prod server.
When I see "type mismatch", I immediately think that maybe the datatype in
the database is different between prod and dev, but that is not the case.
It's an int in both cases.
Can anyone help me?
grab the user's network logon ID. I have chosen to do this with this code:
----------------------------------------------------------------------------
strLogon= Request.ServerVariables("LOGON_USER")
Set RS = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT EmployeeID, DepartmentID "
strSQL = strSQL & "FROM Employee "
strSQL = strSQL & "WHERE NetworkID = '"&strLogon&"'"
RS.Open strSQL, objConnection
'this is to pass the value of the name of the TSE to the next page
Response.Cookies("TSE_ID") = rs("EmployeeID")
strDepartmentID = rs("DepartmentID")
rs.Close
Set rs = Nothing
If strDepartmentID = "9" then
Response.Redirect("DisplayOpenTicketsTSE.asp")
Else
Response.Redirect("DisplayOpenTickets.asp")
end if
----------------------------------------------------------------------------
----
In production, this works just fine. If you happen to be in the tech support
department, (9), it takes you to a page which shows you just your open
tickets, and if not, it takes you to a page which displays all open tickets.
I decided to create a development environment for this app, which I should
have done in the first place, and so I copied the SQL Server 2K database,
then copied the asp code down into my wwwroot directory. The pages which
don't have the cookie code work just fine, but the ones that do have cookie
stuff do not work. These are just browser cookies, and their only purpose is
to get the Windows logon name, nothing else. I have no experience with any
cookies prior to this.
Here's the error message I get:
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'RS(...).Cookies'
/displayopenredirect.asp, line 17
where line 17 is the one in the middle of the above code:
Response.Cookies("TSE_ID") = rs("EmployeeID")
I'm having a hard time understanding why this work in prod, but not in my
dev environment. The dev environment is on the network, so it should be able
to grab my logon name exactly as it does when running from the prod server.
When I see "type mismatch", I immediately think that maybe the datatype in
the database is different between prod and dev, but that is not the case.
It's an int in both cases.
Can anyone help me?