Go Back   Scotland Discussion Forum > Culture > Science and Technology


ASP help???

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 6th January 2005, 19:52
gillybabi gillybabi is offline
Registered User
 
Join Date: Jul 2004
Location: Scotland
Posts: 36
Question

Hey everyone.

Happy New Year to you's all. Hope you's had a grand one.

Ive recently been studying ASP, well for a few months now. But ive came to a stand still.

Its basically. login - if right advance to authorised page
- if wrong go to unauthorised page.

I've got everything working, except this login. The ASP page that checks the login against the database must be the problem, but i cant see any problems with it. My code is

< %

Dim adoCon
Dim strCon
Dim rsCheckUser
Dim strAccessDB
Dim strSQL
Dim strUserName

strUserName = Request.Form("Username")

strAccessDB = "guestbook2"

Set adoCon = Server.CreateObject("ADODB.Connection")

strCon = "DRIVER={Microsoft Access Driver(*.mdb)};uid=;pwd=letmein; DBQ=" & Server.MapPath(strAccessDB)

adoCon.Open strCon

Set rsCheckUser = Server.CreateObject("ADODB.Recordset")

strSQL = "SELECT tblpass.Password FROM tblpass WHERE tblpass.Username ='"& strUserName &"'"

rsCheckUser.Open strSQL, strCon

If NOT rsCheckUser.EOF Then

If (Request.Form("Password")) = rsCheckUser("Password") Then Session("blnlsUserGood")= True

Set adoCon = Nothing
Set strCon = Nothing
Set rsCheckUser = Nothing

Response.Redirect"authorised.asp?Username=" & strUserName

End If
End If

Set adoCon = Nothing
Set strCon = Nothing
Set rsCheckUser = Nothing

Session("blnlsUserGood")= False

Response.Redirect"unauthoriseduser.html"
% >


Dont know if showing the code will do any good, but any help will be greatly appreciated

thanx, kind regards
gillyb x

__________________


'I love it we're soo thick and we're thrilled'

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:44.


Powered by vBulletin® Version 3.7.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC4 © 2006, Crawlability, Inc.