Results 1 to 2 of 2

Thread: [Resolved] Code that has worked, now doesn't work on some computers.

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Indiana
    Posts
    612

    Resolved [Resolved] Code that has worked, now doesn't work on some computers.

    Hi everyone. I have a strange occurence going on that I need to find an answer for.

    I have the following code in my Login page on my web program written in VB .Net 2003.
    VB Code:
    1. Dim cn As New SqlClient.SqlConnection()
    2.  
    3.         cn.ConnectionString = "Integrated Security=True;" & _
    4.         "Data Source=202.101.8.227;Initial Catalog=Problem Tracking;" & _
    5.         "user id=;password=;"
    6.         cn.Open()
    7.  
    8.         Dim commSQL As New SqlClient.SqlCommand
    9.         commSQL.CommandTimeout = 500
    10.         commSQL.Connection = cn
    11.  
    12.         Dim datRead As SqlClient.SqlDataReader
    13.  
    14.         commSQL.CommandText = "Select * From Employee_View Where LoginName = '" & _
    15.         txtUserName.Text & "'"
    16.         datRead = commSQL.ExecuteReader
    17.  
    18.         Dim letter As Char
    19.         Dim strCode, st, strPassword, strEncryptedPass As String
    20.         Dim i, charsInFile, Code As Short
    21.  
    22.         strCode = 19
    23.         Code = CShort(strCode)
    24.  
    25.         strEncryptedPass = ""
    26.         strPassword = LCase(Trim(txtPassword.Text))
    27.         charsInFile = strPassword.Length
    28.         st = ""
    29.         For i = 0 To charsInFile - 1
    30.             letter = strPassword.Substring(i, 1)
    31.             st = (Asc(letter) Xor Code)
    32.             strEncryptedPass += Double.Parse(st).ToString("000")
    33.         Next
    34.  
    35.         If datRead.Read() Then
    36.             Dim strSysPass As String = datRead.Item("EncryptPass")
    37.             Dim strLoginName, strPrivilege, strStores As String
    38.  
    39.             If LCase(strSysPass.Trim()) = LCase(strEncryptedPass.Trim()) Then
    40.                 strLoginName = datRead.Item("LoginName")
    41.                 strPrivilege = datRead.Item("Priveledge")
    42.                 If strPrivilege = "Manager" Then
    43.                     datRead.Close()
    44.                     commSQL.CommandText = "Select * From EmpStores_View " & _
    45.                     "Where LoginName = '" & strLoginName.Trim() & "'"
    46.                     datRead = commSQL.ExecuteReader
    47.                     If datRead.Read() Then
    48.                         strStores = datRead.Item("Stores")
    49.                         Response.Cookies("Store").Value = strStores.Trim()
    50.                         Response.Cookies("Store").Expires = Now.AddDays(1)
    51.                     End If
    52.                 End If
    53.                 Response.Cookies("LoginName").Value = strLoginName.Trim()
    54.                 Response.Cookies("LoginName").Expires = Now.AddDays(1)
    55.                 Response.Cookies("Privilege").Value = strPrivilege.Trim()
    56.                 Response.Cookies("Privilege").Expires = Now.AddDays(1)
    57.                 Response.Cookies("EmpID").Value = datRead.Item("EmpID")
    58.                 Response.Cookies("EmpID").Expires = Now.AddDays(1)
    59.                 Response.Cookies("EmpName").Value = Trim(datRead.Item("Employee"))
    60.                 Response.Cookies("EmpName").Expires = Now.AddDays(1)
    61.                 Response.Redirect("Menu.aspx")
    62.             Else
    63.                 Response.Cookies("LoginName").Value = Nothing
    64.                 Response.Cookies("Privilege").Value = Nothing
    65.                 Response.Cookies("Store").Value = Nothing
    66.                 Response.Cookies("EmpID").Value = Nothing
    67.                 Response.Cookies("EmpName").Value = Nothing
    68.                 Response.Redirect("LoginErr.aspx")
    69.             End If
    70.         End If
    71.         datRead.Close()
    72.         commSQL.Dispose()
    73.         cn.Close()
    74.         cn.Dispose()
    This code has worked fine for months. Now, for some reason I can't figure out, it doens't work.

    After the user types in their user name and password and then clicks the Login Button, nothing happens. No error code, no progressbar appears, just absolutely nothing.

    On one of the machines where this is happening, I set the Internet Explorer settings back to the default. This did not help.

    Anyone have any ideas what is going on here?

    Thanks
    Last edited by indydavid32; Dec 30th, 2004 at 03:34 PM.
    David Wilhelm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width