Forskel på connection strings
Hej Eksperter.Jeg undrer mig lidt over hvad forskellen er på disse måder at forbinde til en database på.
Hvad er forskellen på disse to?
SET rs = Server.CreateObject("ADODB.Connection")
rs.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../../db/usersystem.mdb")
og
SET RS = Server.CreateObject("ADODB.Connection")
rs.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../../db/usersystem.mdb")
Den der er foreslået af webhotellet giver mig en fejl senere i scriptet.
Hele scriptet kan ses her i den for der giver mig en fejl:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE>Login</TITLE>
</HEAD>
<BODY>
<%
SET rs = Server.CreateObject("ADODB.Connection")
rs.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../../db/usersystem.mdb")
If Request("mode") = "Check" then
' Authes user, password, and fixed a known securitybug to many login systems.
strUsername = Trim(Replace(request("username"),"'","''" ))
strPassword = Trim(Replace(request("password"),"'","''" ))
Sql = "Select Count(*) as Found from users where (username = '" & strUsername & "') and (password ='" & strPassword & "')"
Set LO = rs.Execute(Sql) <<<<<<<<<<<Her opstår fejlen!
if LO("Found") = 0 then
Session("login") = ""
error = "You´re not authed be the system"
else
strDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../../db/usersystem.mdb")
Set myConn = Server.CreateObject("ADODB.Connection")
myConn.Open strDSN
strSQL = "SELECT * FROM users where (username = '" & Request("username") & "') and (password ='" & Request("password") & "')"
Set ez = myConn.Execute(strSQL)
Session("login") = "Authed"
Response.Redirect "default.asp"
EZ.Close
RS.Close
Conn.Close
End if
End if
%>
<br>
<center>
<form method="POST" action="login.asp">
<input type="hidden" name="mode" VALUE="Check">
<h1>Velkommen til bandmanager:</h1><br>
<br>
Brugernavn:
<input class='text' type='text' name='username' size='15' value=""><br>
Password:
<input class="text" type="password" value="" name="password" size="15"><br>
<input class="text" type="submit" value="Login" name="submit">
<br><br><%=error%>
</form>
Confused ?? Enter test as both login & password to tjek the script !!
</center>
</BODY>
</HTML>
Fejlmeddelelsen hedder:
error '80004005'
Unspecified error