Login Error using Ultradev in MX

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
CynderWolveAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Saqib KhanSenior DeveloperCommented:
> 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
CynderWolveAuthor Commented:
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
Saqib KhanSenior DeveloperCommented:
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
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

CynderWolveAuthor Commented:
<%@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
CynderWolveAuthor Commented:
I need an answer soon, if possible?  So I increased points a little.
0
Saqib KhanSenior DeveloperCommented:
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
CynderWolveAuthor Commented:
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
Saqib KhanSenior DeveloperCommented:
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
CynderWolveAuthor Commented:
The copy and paste didn't work.  As for permissions, they were the first thing I checked, they are okay.  
0
Saqib KhanSenior DeveloperCommented:
 > 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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CynderWolveAuthor Commented:
*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
CynderWolveAuthor Commented:
It was something to do with the connection - the network guy fixed it for me.

Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Dreamweaver

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.