Konvertering af 97 til 2000
HEJ Jeg har konverteret en Access 97 database til 2000 og så virker mit asp script ikke:-: ( Indhold af default.asp ) :-
------------------------------------------------------
<%
SET rs = Server.CreateObject(\"ADODB.Connection\")
rs.Open \"Driver={Microsoft Access Driver (*.mdb)}; DBQ=\" & Server.MapPath(\"DB.mdb\")
If Request(\"mode\") = \"Check\" then
Sql = \"Select Count(*) as Found from users where (username = \'\" & Request(\"username\") & \"\') and (password =\'\" & Request(\"password\") & \"\')\"
Set Login = Rs.Execute(Sql)
if Login(\"Found\") = 0 then
Session(\"login\") = 0
error = \"Du blev ikke godkendt af systemet\"
else
Session(\"Login\") = 1
Session(\"password-session\") = Request(\"username\")
Response.Redirect \"beskyt.asp\"
end if
else
end if
%>
<HTML>
<HEAD>
</HEAD>
<BODY>
<form method=\"POST\" action=\"Default.asp\">
<input type=\"hidden\" name=\"mode\" VALUE=\"Check\">
<div align=\"center\">
<center>
<table border=\"0\" width=\"20%\" cellspacing=\"0\" cellpadding=\"2\">
<tr>
<td width=\"50%\"><font face=\"Tahoma\" size=\"2\">Username:</font></td>
<td width=\"50%\"><font face=\"Tahoma\" size=\"2\"><input type=\"text\" name=\"username\" size=\"20\" style=\"font-family: Verdana; font-size: 8 pt\"></font></td>
</tr>
<tr>
<td width=\"50%\"><font face=\"Tahoma\" size=\"2\">Password</font></td>
<td width=\"50%\"><font face=\"Tahoma\" size=\"2\"><input type=\"text\" name=\"password\" size=\"20\" style=\"font-family: Verdana; font-size: 8 pt\"></font></td>
</tr>
<tr>
<td width=\"50%\"><font face=\"Tahoma\" size=\"2\"><input type=\"submit\" value=\"Login\" name=\"submit\" style=\"font-family: Verdana; font-size: 8 pt\"></font></td>
<td width=\"50%\"><font face=\"Tahoma\" size=\"1\"><%=error%></td>
</tr>
</table>
</center>
</div>
</form>
</BODY>
</HTML>
------------------------------------------------------
-: ( Indhold slutter her! ) :-
-: ( Indhold af beskyttet side (beskyt.asp) ) :-
------------------------------------------------------
<%
Response.Buffer = True
SET rs = Server.CreateObject(\"ADODB.Connection\")
rs.Open \"Driver={Microsoft Access Driver (*.mdb)}; DBQ=\" & Server.MapPath(\"DB.mdb\")
if request(\"Mode\") = \"logaf\" then
session.Abandon
Response.Redirect(\"default.asp\")
end if
\' Chekker om brugeren har en session.
\' Hvis ikke så smides han af
IF Session(\"password-session\") = \"\" Then
Response.Redirect(\"Default.asp\")
end if
Sql = \"Select * FROM users WHERE username = \'\" & session(\"password-session\") & \"\'\"
set rs = rs.Execute(SQL) %>
Hej <% = rs(\"Name\") %> <br>
Du er nu logget ind!
<a href=\"u-default.asp?mode=logaf\">Log af</a>
------------------------------------------------------
-: ( Indhold slutter her! ) :-
På forhånd TAK!!!!!!