hi to all... i got big prob. here... i can't trap my log in... seems this i have this and i dont know whats wrong with it... every time i put any name on my textbox.. my login.asp page goes to home.asp without trapping.. plz help.. below are my codes...
thnx!
--owell
thnx!
Code:
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<%response.buffer = true%>
<%
Session("DatabasePath") = "C:\Inetpub\wwwroot\thesis\dbase\userdb.mdb"
If Request.Form("btnLogin") = "Login" AND Request.Form("username") <> "" _
AND Request.Form("Password") <> "" Then
'-- Declare your variables
Dim DataConnection, cmdDC, RecordSet
Dim username, password
username = Request.Form("username")
password = Request.Form("password")
'-- Create object and open database
Set DataConnection = Server.CreateObject("ADODB.Connection")
DataConnection.Open "FILEDSN=C:\Inetpub\wwwroot\thesis\dbase\connect.ds n;" & _
"DBQ=" & Session("C:\Inetpub\wwwroot\thesis\dbase\userdb.mdb") & ";"
Set cmdDC = Server.CreateObject("ADODB.Command")
cmdDC.ActiveConnection = DataConnection
....
'-- default SQL
SQL = "SELECT * FROM user_table"
If Request.Form("username") <> "" Then
SQL = "SELECT user_table.* FROM user_table " & _
"WHERE user_table.username='" & username& _
"' AND user_table.password ='" & password & "'"
End If
cmdDC.CommandText = SQL
Set RecordSet = Server.CreateObject("ADODB.Recordset")
--owell

