Wrox Programmer Forums
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 22nd, 2004, 06:17 AM
Registered User
Join Date: Dec 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default login Authentification

hi all the pros out there..I have been trying to catch this bug, can any body pls help me!!!!
the error is this :

Error Type:
Microsoft VBScript compilation (0x800A0408)
Invalid character
/MemoMgnt/Login.asp, line 53
 If objRs.EOF Then

and the code is as follows:

Dim objConn
Dim strDBID
Dim strDBPass
Dim strDB

Dim strSQL

Dim objRs
Dim strError

Function fixQuotes(strData)
  fixQuotes = Replace(strData,"'","''")
End Function

strDB = "MemoMgnt"
strDBID ="sa"
strDBPass ="test"

set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "dsn=" & strDB, strDBID, strDBPass
set objRs = Server.CreateObject("ADODB.Recordset")

strSQL = "SELECT PWD,Status FROM UserTable WHERE uid='" &_
         Request("UserName") & "'"

objRs.open strSQL,objConn
'Set objRs = objConn.Execute (strSQL)
'//see if there are any records returned
response.write objRs.fields(0)
If objRs.EOF Then
          'no username found
          strError = "- Invalid username or password<br>" & vbNewLine
          'check password
          If objRs("PWD")=Request.Form("Password") Then
               'username/password valid
               'save session data
               Session("loggedin") = True
               Session("userid") = objRs("UID")
               'redirect to members area
               Response.Redirect ("MainMgnt.asp")
               'invalid password
               strError = "- Invalid username or password<br>" & vbNewLine
          End If
      End If

If strError <> "" Then
End If

'//log out

Set objConn = Nothing
Set objRs = Nothing

Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP 3.0 Book - ASDI Authentification Fred_123 Classic ASP Professional 0 March 8th, 2005 12:58 PM
login failed for user nt authority\anonymous login rj1406 Classic ASP Databases 1 October 24th, 2004 09:15 AM
Session and Cookie authentification dsunmedia PHP How-To 2 August 30th, 2004 06:52 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.