Solved

Login Error using Ultradev in MX

Posted on 2003-12-02
12
292 Views
Last Modified: 2010-04-25
I'm using Dreamweaver MX Version 6.1 with a MS Access database, using ASP VBscript to make the site.  I can retrieve information okay, but I am getting an 'unspecified error' when I try to make a login page. On this page, I created a recordset to choose all the information from the table with the login information, and then used the 'Log In User' server behavior to make it work.

However, when I go test it with a log in information that I know is in the database, I get this error:

Error Type:
Provider (0x80004005)
Unspecified error
/InMotion/login.asp, line 8

The line that it is having problems with is:

MM_rsUser.ActiveConnection = MM_InMotion_STRING

I've done several things to try and repair it (including following a login tutorial that set it up differently, using the recordset to grab specific information), and it always have a problem with that particular line.  'InMotion' is the name of the site.  

Any help is appreciated.  Do I need to give any more information?  

Thanks!

- Heather
0
Comment
Question by:CynderWolve
  • 7
  • 5
12 Comments
 
LVL 23

Expert Comment

by:adilkhan
ID: 9859151
> MM_InMotion_STRING
this line defines your Connection String. are You sure you have well formed Alphanumeric names for your Database file and fields?

You need to post some of the Code that deals with your Database Connection.

some code around Adodb.Connection...
0
 

Author Comment

by:CynderWolve
ID: 9859734
This is in the Connections folder, and is included on the page:

<%
' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="true"
' Catalog=""
' Schema=""
Dim MM_InMotion_STRING
MM_InMotion_STRING = "dsn=InMotion;"
%>

Do you need any other info?  This is my first time working in MX with a database, so I'm still learning exactly what information points to what.  I didn't see anything that said 'Adodb.Connection', but looking at this it may be the same thing?

I think that I have well formed Alphanumeric Names for my Database file and fields - the database is EmployeeInfo, the table name is LoginInfo, the fields are Login and Password.

- Heather
0
 
LVL 23

Expert Comment

by:adilkhan
ID: 9859959
You said you can retrieve the information from Database, this means Your connection is good with the database, problem resides with the Login page.
Post Login page Script.
0
 

Author Comment

by:CynderWolve
ID: 9860237
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/InMotion.asp" -->
<%
Dim rsLogin__strUserId
rsLogin__strUserId = "xyz"
If (Request.Form("login")  <> "") Then
  rsLogin__strUserId = Request.Form("login")
End If
%>
<%
Dim rsLogin__strPassword
rsLogin__strPassword = "abc"
If (Request.Form("password")  <> "") Then
  rsLogin__strPassword = Request.Form("password")
End If
%>
<%
Dim rsLogin
Dim rsLogin_numRows

Set rsLogin = Server.CreateObject("ADODB.Recordset")
rsLogin.ActiveConnection = MM_InMotion_STRING
rsLogin.Source = "SELECT *  FROM LoginInfo  WHERE Login='" + Replace(rsLogin__strUserId, "'", "''") + "' AND Password='" + Replace(rsLogin__strPassword, "'", "''") + "'"
rsLogin.CursorType = 0
rsLogin.CursorLocation = 2
rsLogin.LockType = 1
rsLogin.Open()

rsLogin_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("login"))
If MM_valUsername <> "" Then
  MM_fldUserAuthorization=""
  MM_redirectLoginSuccess="employeeMain.asp"
  MM_redirectLoginFailed="loginFailed.asp"
  MM_flag="ADODB.Recordset"
  set MM_rsUser = Server.CreateObject(MM_flag)
  MM_rsUser.ActiveConnection = MM_InMotion_STRING
  MM_rsUser.Source = "SELECT Login, Password"
  If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
  MM_rsUser.Source = MM_rsUser.Source & " FROM LoginInfo WHERE Login='" & Replace(MM_valUsername,"'","''") &"' AND Password='" & Replace(Request.Form("password"),"'","''") & "'"
  MM_rsUser.CursorType = 0
  MM_rsUser.CursorLocation = 2
  MM_rsUser.LockType = 3
  MM_rsUser.Open
  If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
    ' username and password match - this is a valid user
    Session("MM_Username") = MM_valUsername
    If (MM_fldUserAuthorization <> "") Then
      Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
    Else
      Session("MM_UserAuthorization") = ""
    End If
    if CStr(Request.QueryString("accessdenied")) <> "" And false Then
      MM_redirectLoginSuccess = Request.QueryString("accessdenied")
    End If
    MM_rsUser.Close
    Response.Redirect(MM_redirectLoginSuccess)
  End If
  MM_rsUser.Close
  Response.Redirect(MM_redirectLoginFailed)
End If
%>
<HTML>
<HEAD>
<TITLE>Add Log-In Information</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>

<BODY>
<FORM ACTION="<%=MM_LoginAction%>" METHOD="POST" NAME="Login" ID="Login">
<TABLE WIDTH="500" HEIGHT="300" BORDER="1" ALIGN="CENTER" CELLPADDING="0" CELLSPACING="0" BORDERCOLOR="#3366CC" BGCOLOR="#FFFFFF">
            <TR>
                        <TD VALIGN="TOP" BORDERCOLOR="#000000" BGCOLOR="#FFFFFF"><TABLE WIDTH="100%" HEIGHT="100%" BORDER="0" CELLPADDING="3" CELLSPACING="0">
                                    <TR>
                                                <TD WIDTH="28%" HEIGHT="154" VALIGN="TOP"><IMG SRC="DUinMotionLogo.jpg" ALT="Dalton Utilities In Motion" WIDTH="120" HEIGHT="120"></TD>
                                                <TD WIDTH="72%" VALIGN="TOP"><P ALIGN="CENTER"><FONT FACE="Arial, Helvetica, sans-serif"><STRONG>Welcome
                                                                                    to Dalton Utilities In
                                                                                    Motion</STRONG></FONT></P>
                                                            <P ALIGN="CENTER"><FONT FACE="Arial, Helvetica, sans-serif">Please
                                                            login to enter your walking information.</FONT></P>                                                            <TABLE WIDTH="227" BORDER="0" ALIGN="CENTER" CELLPADDING="0" CELLSPACING="0">
                                                                        <TR>
                                                                                    <TD WIDTH="70"><FONT FACE="Arial, Helvetica, sans-serif">Login:</FONT></TD>
                                                                                    <TD WIDTH="157"><INPUT NAME="login" TYPE="text" ID="login"></TD>
                                                                        </TR>
                                                                        <TR>
                                                                          <TD><P><FONT FACE="Arial, Helvetica, sans-serif">Password:</FONT> </P></TD>
                                                                                    <TD><INPUT NAME="password" TYPE="PASSWORD" ID="password2">
</TD>
                                                                        </TR>
                                                                        <TR>
                                                                                    <TD COLSPAN="2">
                                                                                            <DIV ALIGN="LEFT">
                                                                                              <INPUT TYPE="submit" NAME="Submit" VALUE="Login">
                                                                                            </DIV></TD>
                                                                        </TR>
                                                  </TABLE>                                                            
                                                  <P ALIGN="CENTER">&nbsp;</P>
                                      </TD>
                                    </TR>
                        </TABLE>                        
              </TD>
            </TR>
</TABLE>

</FORM>
<P>&nbsp;</P>
</BODY>
</HTML>
<%
rsLogin.Close()
Set rsLogin = Nothing
%>
0
 

Author Comment

by:CynderWolve
ID: 9868268
I need an answer soon, if possible?  So I increased points a little.
0
 
LVL 23

Expert Comment

by:adilkhan
ID: 9868861
CynderWolve I looked at your code, You are repeating same information Twice.

I believe the Top part is custom Scripting that you or somebody else did for the Login page and then the Bottom part is the programming that DW did for you. You repeating same information twice.

<%
Dim rsLogin__strUserId
rsLogin__strUserId = "xyz"
If (Request.Form("login")  <> "") Then
  rsLogin__strUserId = Request.Form("login")
End If
%>
<%
Dim rsLogin__strPassword
rsLogin__strPassword = "abc"
If (Request.Form("password")  <> "") Then
  rsLogin__strPassword = Request.Form("password")
End If

Dim rsLogin
Dim rsLogin_numRows

Set rsLogin = Server.CreateObject("ADODB.Recordset")
rsLogin.ActiveConnection = MM_InMotion_STRING
rsLogin.Source = "SELECT *  FROM LoginInfo  WHERE Login='" + Replace(rsLogin__strUserId, "'", "''") + "' AND Password='" + Replace(rsLogin__strPassword, "'", "''") + "'"
rsLogin.CursorType = 0
rsLogin.CursorLocation = 2
rsLogin.LockType = 1
rsLogin.Open()

if not rsLogin.eof then
' user loged in
else
'wrong user/password
end if

%>

this should work for your login Script.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:CynderWolve
ID: 9869654
Sorry, guess I didn't get the macromedia code out when I tried the tutorial.  I'm sure that didn't help, and have a page with your code now. :}  But I don't think that's the problem, as I've stumbled on something else:

I was working on another page, and noticed that it would work the first time I loaded it, then would give me problems whenever I refreshed it.  Checked my pages, and that's happening on all of them - the same 'Unspecified Error' problem, pointing to the line that has the ActiveConnection = MM_InMotion_String part in it.  

So apparently the connection works only once?  Have you run into that?  Hopefully know what causes it and how to fix it?
0
 
LVL 23

Expert Comment

by:adilkhan
ID: 9870391
hmmm.
then try this

Copy ans Paste your Access MDB file.
rename it to something else. and delete the older one.
Modify your Connection string in DW to have the new name updated.

also make sure MDB file has correct permissions by doing right Click Choose properties and make sure it has read/write permission for IUR_Computer NAME.
0
 

Author Comment

by:CynderWolve
ID: 9876103
The copy and paste didn't work.  As for permissions, they were the first thing I checked, they are okay.  
0
 
LVL 23

Accepted Solution

by:
adilkhan earned 350 total points
ID: 9876346
 > its works first time then it stops working....

Problem is with the Database Connection, or maybe your computer, Test it on a different Machine play around with your Connection String.
Currently you using DSN connection try using DSN-LESS connection.
0
 

Author Comment

by:CynderWolve
ID: 9876423
*nod*  Ok, I'll play around with it, and talk to the network guy to see if he knows how to fix whatever is going on.  At least now I have a lead more specific than 'unspecified error'.  I'll post any updates, give points when it's fixed (in case someone else comes by and knows exactly what's going on).  Thanks!
0
 

Author Comment

by:CynderWolve
ID: 9941549
It was something to do with the connection - the network guy fixed it for me.

Thanks!
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now