Website database access problem - help needed

Soldato
Joined
10 Aug 2003
Posts
2,696
Location
London
I have a website which was running fine on my old server running Win 2000 server. I have now moved this website to a server running win server 2003.
The website has a simple script/code which checks a access database for the username and password.

Having moved the website to the win 2003 server when i run the website I get this error message:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xc98 Thread 0x394 DBC 0x18fcfcc Jet'.

/intranet/check_user.asp, line 30

Here is the asp file check_user.asp

<%
'Dimension variables
Dim adoCon 'Database Connection Variable
Dim strCon 'Holds the Database driver and the path and name of the database
Dim rsCheckUser 'Database Recordset Variable
Dim strAccessDB 'Holds the Access Database Name
Dim strSQL 'Database query sring
Dim strUserName 'Holds the user name
Dim strFName 'Holds the user Fname
Dim strSurName 'Holds the user Surname



'Initalise the strUserName variable
strUserName = Request.Form("txtUserName")

'Check the database to see if user exsits and read in there password
'Initialise the strAccessDB variable with the name of the Access Database
strAccessDB = "users"

'Create a connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")

'Database connection info and driver
strCon = "DRIVER={Microsoft Access Driver (*.mdb)};uid=;pwd=XXXX; DBQ=" & Server.MapPath(strAccessDB)

adoCon.mode = 3

'Set an active connection to the Connection object
adoCon.Open strCon


'Create a recordset object
Set rsCheckUser = Server.CreateObject("ADODB.Recordset")

'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT tblUsers.Password, tblUsers.Fname,tblUsers.UserID FROM tblUsers WHERE tblUsers.UserID ='" & strUserName & "'"


'Query the database
rsCheckUser.Open strSQL, strCon



'If the recordset finds a record for the username entered then read in the password for the user
If NOT rsCheckUser.EOF Then

StrFName = rsCheckUser("Fname")
'Read in the password for the user from the database
If (Request.Form("txtUserPass")) = rsCheckUser("Password") Then

'If the password is correct then set the session variable to True
Session("blnIsUserGood") = True
Session("User") = rsCheckUser("UserID")



'Close Objects before redirecting
Set adoCon = Nothing
Set strCon = Nothing
Set rsCheckUser = Nothing


'Redirect to the authorised user page and send the users name


Response.Redirect"./index.asp?name=" & strFName
End If

Response.Redirect"../unsecure.asp"

else

End If

'Close Objects
Set adoCon = Nothing
Set strCon = Nothing
Set rsCheckUser = Nothing

'If the script is still running then the user must not be authorised
Session("blnIsUserGood") = False

'Redirect to the unautorised user page
Response.Redirect"../unsecure.asp"
%>

Can anyone help me pinpoint where the problem is and how to rectify it?

Thanks in advance guys :)
 
Not sure this will fix your problem but worth a shot..

Code:
strAccessDB = "users.mdb"  ' <-- This should be the full filename of your access database
...
strCon = "DRIVER={Microsoft Access Driver (*.mdb)};uid=;pwd=XXXX;dbq=" & Server.MapPath(strAccessDB) & ";"
 
Ok, then check the following:

  • Path to the database is correct i.e. your are using the physical path on the server to the database and not a virtual path.
  • The error is also quite common if the permissions on the server are incorrect. Check that IIS has sufficient permissions to access the registry and that the correct permissions, read and write, are set on the directory containing the database and the database itself, for the IUSR account.
 
the database is in the same folder as the script so that should not make a difference.. but i will try it.
 
Back
Top Bottom