Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 16th, 2003, 01:39 PM
Registered User
 
Join Date: Dec 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Authentication Connection Problem

(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"%>

<%
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

 
Old December 16th, 2003, 02:34 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.
 
Old December 16th, 2003, 03:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

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
 
Old December 16th, 2003, 03:17 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.
 
Old December 16th, 2003, 04:27 PM
Registered User
 
Join Date: Dec 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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


 
Old December 16th, 2003, 04:42 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.
 
Old December 16th, 2003, 05:10 PM
Registered User
 
Join Date: Dec 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

 
Old December 16th, 2003, 05:15 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Access db connection with forms authentication ChronoSys ASP.NET 1.0 and 1.1 Basics 0 May 12th, 2006 09:14 AM
User Authentication problem asif_sharif ASP.NET 1.0 and 1.1 Professional 1 January 1st, 2006 04:48 PM
Problem NTLM Authentication mmalik_altaf J2EE 1 November 18th, 2003 05:08 PM
Authentication Problem CW Classic ASP Databases 2 October 30th, 2003 06:12 AM
IP authentication problem mateenmohd SQL Server 2000 0 August 24th, 2003 04:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.