ASP & ACCESS
Can sombody please help me?? I now realize that perhaps it would have been easier to use PHP to do this, however I do not really have the time to start over now. I am trying to create a user logon to protect some of the pages on a clients website using ACCESS and ASP Scripting and am having alot of problems with my scripting.
Here is the code I am attempting to use:
<%
Dim adoCon
Dim strSQL
Dim rslogin
Dim strCon
Dim DbasePath
DbasePath = "fpdb/user_login.mdb"
strCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & DbasePath
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.ConnectionString = strCon
adoCon.Open
Dim GetUsername
Dim GetPassword
Dim GetAccess
Set rsLogin = Server.CreateObject("ADODB.Recordset")
GetUsername = Request.Form("usernamebox")
GetPassword = Request.Form("passwordbox")
If GetUsername <> "" AND GetPassword <> "" Then
strSQL = "SELECT * FROM tblLogin WHERE username = '" & GetUsername & "' AND password = '" & GetPassword & "'"
rsLogin.open strSQL, adoCon
If not rsLogin.EOF Then
GetAccess = rsLogin("accesslevel")
Session("AccessLevel") = GetAccess
Response.Redirect("practice_001.htm")
Else
Response.Redirect("access_denied.htm")
End If
Else
Response.Redirect("access_denied.htm")
End If
%>
The problem that keeps on occuring involes actually being able to find and pull information from the ACCESS Database though the asp code.
Can someone please point me in the right direction?
Thanks a bunch!!
|