| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
ASP login code/script error
hi all,
i recently aquired a sample login script and tested on asp enabled webservers, then i wanted to add it to my iis 5.1 assembly for a simple login script for my web site but do not know howto do this properly, i know it is not already activated as i get an error reading: Error Type: Server object, ASP 0177 (0x800401F3) Invalid class string /asp/check_user.asp, line 18 any ideas? thanks, commekid |
|
#2
|
||||
|
||||
|
Can you post your script here?
MK |
|
#3
|
|||
|
|||
|
the page where i get the error is coded as follows
<% '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 '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=letmein; DBQ=" & Server.MapPath(strAccessDB) '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 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 '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 '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"authorised_user_page.asp?name=" & strUserName End If 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"unauthorised_user_page.htm" %> |
|
#4
|
||||
|
||||
|
Hi
I seem to remember this problem being fixed by installing the last MDAC: http://www.microsoft.com/downloads/...&displaylang=en Might be worth a try? MK |
|
#5
|
|||
|
|||
|
hay thanks 4 reply,
i have done as you have instructed but now i get this error: Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xe58 Thread 0xf48 DBC 0x159178c Jet'. /asp/check_user.asp, line 24 any ideas? ty |
|
#6
|
|||
|
|||
|
red another thread and fixed error
ty anyway great forum |
|
#7
|
||||
|
||||
|
Can you post the solution here for other users? This issue can often be solved by reinstalling MDAC and rebooting the server
MK |
|
#8
|
|||
|
|||
|
sure, the link to the thread is here:
http://forums.aspfree.com/t18145/s.html i did the bit that set some more permissions |
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > ASP login code/script error |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|