scriptblur
09-11-2002, 08:07 AM
Hi there,
Any kind souls can help me???:(
Example i got two table names in the database... Student and Staff in Login.dbm... i had already know how to login with one table name using SQL statement(below). But if i got 2 table names in one database... how to interact????
Like when i login as student it will interact with the student table in the database and proceed... or if I login as staff, it will interact with the staff table in the database and proceed. Thank u...
<%@ Language=VBScript %>
<% Option Explicit %>
<%
Dim conn,rs,sql
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("login.mdb"))
set rs=Server.CreateObject("ADODB.Recordset")
sql = "SELECT * FROM Staff WHERE UserID = '" & Request.Form("UserID") &"' AND Password = '" & Request.Form("Password") &"'"
rs.Open sql,conn
If rs.EOF Then
Response.Redirect "Failed.asp"
else
Response.Redirect "content.htm"
End If
%>
Any kind souls can help me???:(
Example i got two table names in the database... Student and Staff in Login.dbm... i had already know how to login with one table name using SQL statement(below). But if i got 2 table names in one database... how to interact????
Like when i login as student it will interact with the student table in the database and proceed... or if I login as staff, it will interact with the staff table in the database and proceed. Thank u...
<%@ Language=VBScript %>
<% Option Explicit %>
<%
Dim conn,rs,sql
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("login.mdb"))
set rs=Server.CreateObject("ADODB.Recordset")
sql = "SELECT * FROM Staff WHERE UserID = '" & Request.Form("UserID") &"' AND Password = '" & Request.Form("Password") &"'"
rs.Open sql,conn
If rs.EOF Then
Response.Redirect "Failed.asp"
else
Response.Redirect "content.htm"
End If
%>