Authentication failed
I'm trying to connect to an access database and I'm getting an Authentication failed error. At this point, I'm only trying to read the file.
What are the possible things that can cause this error?
Here's my code.
<%
Dim adOpenForwardOnly, adLockReadOnly, adCmdTable
adOpenForwardOnly = 0
adLockReadOnly = 1
adCmdTable = 2
Dim objConn, objRS
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.Recordset")
Dim strDatabaseType
'Choose one of the following two lines, and comment out the other
strDatabaseType = "Access"
'strDatabaseType = "MSDE"
Dim strServerPath
Dim strOpenString
strServerPath = Server.MapPath("/data/Movie2000.mdf")
strOpenString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
strServerPath
'Now we use this selection to open the connection in the appropriate way
If strDatabaseType = "Access" Then
objConn.Open strOpenString
Else
objConn.Open "Provider=SQLOLEDB;Persist Security Info=False;" & _
"User ID=sa;Initial Catalog=Movie;" & _
"Initial File Name=C:\MSSQL7\Data\Movie2000.mdf"
End If
objRS.Open "Movies", objConn, adOpenForwardOnly, adLockReadOnly, adCmdTable
While Not objRS.EOF
Response.Write objRS("Title") & "<BR>"
objRS.MoveNext
Wend
objRS.Close
objConn.Close
Set objRS = Nothing
Set objConn = Nothing
%>
|