|
Subject:
|
Authentication Connection Problem
|
|
Posted By:
|
johndove
|
Post Date:
|
12/16/2003 12:39:29 PM
|
(Using IIS 5, Dreamweaver MX)
I am attempting to get the authentication of a login .asp page working correctly. This is my first attempt at this; I am NOT an experienced programmer. An experienced programmer did however set up the 'Login.asp' code that follows:
(FILE NAME: ‘Login.asp’)
<% ' FileName="Connection_odbc_conn_dsn.htm" ' Type="ADO" ' DesigntimeType="ADO" ' HTTP="false" ' Catalog="" ' Schema="" 'Dim MM_LoginConnection_STRING 'MM_Login_STRING = "dsn=Login;" 'dim cnData set cnData = server.createobject("adodb.connection") Datapath = Server.Mappath("./Database/HDS-LoginEnc.mdb") conString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Datapath & ";UserID=;Password=;" CnData.open conString %>
- - - On my login page, my code (relevant code) is the following:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <!--#include file="Connections/Login.asp" --> <% Dim TestConnect Dim TestConnect_numRows
Set TestConnect = Server.CreateObject("ADODB.Recordset") 'TestConnect.ActiveConnection = MM_Login_STRING 'Use the Connection object CnData created in the include file as your Data source TestConnect.ActiveConnection = CnData TestConnect.Source = "SELECT UserID, Password FROM HDSClientLogin" TestConnect.CursorType = 0 TestConnect.CursorLocation = 2 TestConnect.LockType = 1 TestConnect.Open()
TestConnect_numRows = 0 %> <% ' *** Validate request to log in to this site. MM_LoginAction = Request.ServerVariables("URL") If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Request.QueryString MM_valUsername=CStr(Request.Form("UserID")) If MM_valUsername <> "" Then MM_fldUserAuthorization="" MM_redirectLoginSuccess="HDS-MemberLoginSuccessful.htm" MM_redirectLoginFailed="HDSdeniedaccess.asp" MM_flag="ADODB.Recordset" set MM_rsUser = Server.CreateObject(MM_flag) 'MM_rsUser.ActiveConnection = MM_LoginConnection_STRING_________________>>>>>>>>>>>>>>>>>>>>>>>>> MM_rsUser.ActiveConnection = CnData MM_rsUser.Source = "SELECT UserID, Password"
- - - When I view the login page in the browser (IE6), I get error:
HTTP 500.100 - Internal Server Error - ASP error Internet Information Services • Error Type: Microsoft JET Database Engine (0x80004005) Could not find installable ISAM. /HDSsite/Connections/Login.asp, line 14
— Line 14 of ‘Login.asp’ is: CnData.open conString
I don’t know what code change is needed here to make this login page work correctly. Any help appreciated.
Thanks,
John
|
|
Reply By:
|
Imar
|
Reply Date:
|
12/16/2003 1:34:24 PM
|
There are at least two things to look at in your connection code:
1. Does Server.Mappath("./Database/HDS-LoginEnc.mdb") return a valid path? That is, is the database actually located there? If you have a Database folder in the root of your site, try: Server.Mappath("/Database/HDS-LoginEnc.mdb") instead.
2. AFAIK, it should be User ID and not UserID.
Cheers,
Imar
--------------------------------------- Imar Spaanjaars Everyone is unique, except for me.
|
|
Reply By:
|
pgtips
|
Reply Date:
|
12/16/2003 2:07:44 PM
|
Doesn't "Could not find installable ISAM" mean that it couldn't find the db driver? John have you got the Access Jet drivers installed? They're not in MDAC anymore as from v2.6
|
|
Reply By:
|
Imar
|
Reply Date:
|
12/16/2003 2:17:04 PM
|
True, although IIS 5 had me believe he's using Win 2000 which has the right drivers, AFAIK.
It's one of those "catch all" error messages, I guess. It is also used when you use DataSource instead of Data Source. I think that what happens is that the code tries to initialize the driver, doesn't recognize it as an existing driver, and throws this error. I think that conString = "Bla" would cause the same error, although I haven't tried that one yet.
Imar
--------------------------------------- Imar Spaanjaars Everyone is unique, except for me.
|
|
Reply By:
|
johndove
|
Reply Date:
|
12/16/2003 3:27:23 PM
|
Thanks for your replies guys. Sorry for my late reply; I had to step away for a meeting...
IMAR: Yes, Server.Mappath("./Database/HDS-LoginEnc.mdb") IS a valid path so that's not the problem...AND, you are correct in that I do have the right DB driver.
EUREKA! - Changing 'UserID' to 'User ID' as you suggested in the connections file worked... - LOCALLY that is, all my .asp files now work correctly in a browser LOCALLY. My local IIS directory structure is exactly the same as my remote one. BUT...when I uploaded modified files to server, I'm still getting a '500' error: HTTP 500 - Internal server error Internet Explorer
Click the 'Login' button on this page:
http://www.healthdataservices.com/HDSmain.htm
Don't know why I'm getting this error...any idea? I have a feeling something simple is amiss here. I'd be happy to pass along any code if you need a glance..
Thanks again,
John
|
|
Reply By:
|
Imar
|
Reply Date:
|
12/16/2003 3:42:07 PM
|
Hi John,
I think you need to disable friendly HTTP error messages in your browser. This will give you more and useful error info. You'll find the option on the Advanced tab of the Internet Options dialog of Internet Explorer.
When you change the option and run the page again, you'll see this error message:
Microsoft JET Database Engine error '80004005'
'C:\Inetpub\wwwroot\HDSsite\Database\HDS-LoginEnc.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
/Connections/Login.asp, line 14
Apparently, C:\Inetpub\wwwroot\HDSsite\Database\HDS-LoginEnc.mdb does not exist at the server. Did you upload the database? And did you put it in the right folder?
Cheers,
Imar
--------------------------------------- Imar Spaanjaars Everyone is unique, except for me.
|
|
Reply By:
|
johndove
|
Reply Date:
|
12/16/2003 4:10:11 PM
|
Imar,
You are quite correct! In my 'connections' code, I forgot to set the right path to the database directory on the web server (which is a different path than my local environment) - correcting this, plus some other minor code changes for my various .asp pages did the trick!!
Your fine help is most appreciated!! THANK YOU!!
John D.
P.S. - I am a designer, just now learning .asp. I just bought 'Beginning ASP 3.0' and am not far into it. By the time I reach the back cover, I hope to have a much better grasp. Any other resources you would recommend (for the 'geek-challenged', that is)?
Thanks,
John
|
|
Reply By:
|
Imar
|
Reply Date:
|
12/16/2003 4:15:52 PM
|
Judging from your code, it looks like you're using Dreamweaver, so here's a good suggestion:
<shameless plug> http://www.wrox.com/books/0764544047.shtml </shameless plug>
This book discusses stuff like this. It's using Dreamweaver extensively, but much more for coding than for the "traditional Dreamweaver task": designing. Especially section 2 and 3 are code heavy, getting into server side concepts, like ASP programming, using ADO / Databases, etc.
Cheers,
Imar
--------------------------------------- Imar Spaanjaars Everyone is unique, except for me.
|