Insert a Microsoft Access 2000 database in Microsoft Frontpage 200

A

Aya

I've created a microsoft access database a year ago and now I've been
assigned to integrate my database on the internet. And actually I don't have
a lot of knowledge on how I'm going to integrate it in the site.

By far, I know how to make the database connection with Frontpage using the
Database Results. The connection is working pretty well, but I have a
problem. I've created a Log In page and saved it as ASP for a trial with the
connection of my database before I continue working with the rest of the data.

For the Log In page, I've use the Users table I've created in my Access
database and added it's attributes in Frontpage. When I put it to preview the
trial in Internet Explorer, it doesn't show the data or it doesn't respond.
I've also tried using a SQL Server that was created before and it shows the
same result that I've mentioned previously.

Any help here would be appreciated about the database connection with
Frontpage.
 
A

Aya

In case, I'll show you the procedure in my Log In page in case for better
explanation on it.


<%
' FP_ASP ASP Automatically generated by a Frontpage Component. Do not Edit.

On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 1252
Err.Clear

strErrorUrl = "login_failed.asp"

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
Err.Clear

Set fp_conn = Server.CreateObject("ADODB.Connection")
FP_DumpError strErrorUrl, "Cannot create connection"

Set fp_rs = Server.CreateObject("ADODB.Recordset")
FP_DumpError strErrorUrl, "Cannot create record set"

fp_conn.Open Application("Safety_ConnectionString")
FP_DumpError strErrorUrl, "Cannot open database"

fp_rs.Open """Cuentas Usuarios""", fp_conn, 1, 3, 2 ' adOpenKeySet,
adLockOptimistic, adCmdTable
FP_DumpError strErrorUrl, "Cannot open record set"

fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record set to the database"
Dim arFormFields0(2)
Dim arFormDBFields0(2)
Dim arFormValues0(2)

arFormFields0(0) = "username"
arFormDBFields0(0) = "username"
arFormValues0(0) = Request("username")
arFormFields0(1) = "password"
arFormDBFields0(1) = "password"
arFormValues0(1) = Request("password")

FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0


fp_rs.Update
FP_DumpError strErrorUrl, "Cannot update the database"

fp_rs.Close
fp_conn.Close

Session("FP_SavedFields")=arFormFields0
Session("FP_SavedValues")=arFormValues0
Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")
Response.Redirect "Logged_in.asp"

End If
End If

Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")

%>
<%@ Language=VBScript %><html>

<head>
<meta name="VI60_defaultClientScript" content="VBScript">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Impact Safety Analysis - Log In to System</title>
<meta name="Microsoft Theme" content="pixel 011, default">
</head>

<body background="_themes/pixel/pixbkgnd.gif" bgcolor="#FFFFFF"
text="#000000" link="#6666CC" vlink="#999999"
alink="#663333"><!--mstheme--><font face="arial, Arial, Helvetica">
<form BOTID="0" METHOD="POST" action="Log%20In.asp"
webbot-action="--WEBBOT-SELF--">
<!--webbot bot="SaveDatabase" SuggestedExt="asp" S-DataConnection="Safety"
S-RecordSource="Cuentas Usuarios" U-Confirmation-Url="Logged_in.asp"
U-Validation-Error-Url="login_failed.asp" S-Form-Fields="username password"
S-Form-DBFields="username password" U-ASP-Include-Url="_fpclass/fpdbform.inc"
startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include
file="_fpclass/fpdbform.inc"--><!--webbot bot="SaveDatabase"
i-checksum="40548" endspan --><p style="margin-top: 0; margin-bottom: 0"> </p>
<!--mstheme--></font><table BORDER="0">
<tr>
<td><!--mstheme--><font face="arial, Arial,
Helvetica"><b>username</b><!--mstheme--></font></td>
<td><!--mstheme--><font face="arial, Arial, Helvetica"><input
NAME="username" size="20"><!--mstheme--></font></td>
</tr>
<tr>
<td><!--mstheme--><font face="arial, Arial,
Helvetica"><b>password</b><!--mstheme--></font></td>
<td><!--mstheme--><font face="arial, Arial, Helvetica">
<p style="margin-top: 0; margin-bottom: 0">
<input TYPE="password" NAME="password"
size="20"><!--mstheme--></font></td>
</tr>
</table><!--mstheme--><font face="arial, Arial, Helvetica">
<p style="margin-top: 0; margin-bottom: 0"> </p>
<p style="margin-top: 0; margin-bottom: 0">
<!--webbot bot="SaveAsASP" clientside suggestedext="asp" preview=" "
startspan --><!--webbot bot="SaveAsASP" endspan --><input TYPE="submit"
name="LogIn" value="Log In"></p>
</form>
<!--webbot bot="DatabaseRegionStart" s-columnnames="username,password"
s-columntypes="202,202" s-dataconnection="Safety" b-tableformat="FALSE"
b-menuformat="FALSE" s-menuchoice="username" s-menuvalue="username"
b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE"
b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="TRUE"
s-recordsource="Cuentas Usuarios" s-displaycolumns="username,password"
s-criteria="[username] EQ {username} + [password] EQ {password} +" s-order
s-sql="SELECT * FROM &quot;Cuentas Usuarios&quot; WHERE (username =
'::username::' AND password = '::password::')" b-procedure="FALSE"
clientside suggestedext="asp"
s-defaultfields="username=test&amp;password=test" s-norecordsfound="No
récords existentes." i-maxrecords="256" i-groupsize="0" botid="0"
u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc"
u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="BODY" preview="<table border=0
width="100%"><tr><td bgcolor="#FFFF00" align="left"><font
color="#000000">This is the start of a Database Results region. The page must
be fetched from a web server with a web browser to display correctly; the
current web is stored on your local disk or
network.</font></td></tr></table>" b-WasTableFormat="FALSE" startspan
--><!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database
Results component on this page is unable to display database content. The
page must have a filename ending in '.asp', and the web must be hosted on a
server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM ""Cuentas Usuarios"" WHERE (username =
'::username::' AND password = '::password::')"
fp_sDefault="username=test&password=test"
fp_sNoRecords="No récords existentes."
fp_sDataConn="Safety"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice="username"
fp_sMenuValue="username"
fp_iDisplayCols=2
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan --><p><b>
username:</b>&nbsp;<!--webbot bot="DatabaseResultColumn"
s-columnnames="username,password" s-column="username" b-tableformat="FALSE"
b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1">&lt;&lt;</font>username<font size="-1">&gt;&gt;</font>" startspan
--><%=FP_FieldVal(fp_rs,"username")%><!--webbot bot="DatabaseResultColumn"
endspan --></p>
<p><b>password:</b> <!--webbot bot="DatabaseResultColumn"
s-columnnames="username,password" s-column="password" b-tableformat="FALSE"
b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1">&lt;&lt;</font>password<font size="-1">&gt;&gt;</font>" startspan
--><%=FP_FieldVal(fp_rs,"password")%><!--webbot bot="DatabaseResultColumn"
endspan --></p>
<!--msthemeseparator--><p align="center"><img
src="_themes/pixel/apixrule.gif" width="600" height="10"></p>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE"
b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0"
clientside tag="BODY" preview="<table border=0 width="100%"><tr><td
bgcolor="#FFFF00" align="left"><font color="#000000">This is the end of a
Database Results region.</font></td></tr></table>" startspan --><!--#include
file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan
--><!--mstheme--></font></body></html>
 
S

Stefan B Rusynko

Start by Removing all spaces from your DB tables (Cuentas Usuarios) and ASP action pages (Log In.asp)

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| In case, I'll show you the procedure in my Log In page in case for better
| explanation on it.
|
|
| <%
| ' FP_ASP ASP Automatically generated by a Frontpage Component. Do not Edit.
|
| On Error Resume Next
| Session("FP_OldCodePage") = Session.CodePage
| Session("FP_OldLCID") = Session.LCID
| Session.CodePage = 1252
| Err.Clear
|
| strErrorUrl = "login_failed.asp"
|
| If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
| If Request.Form("VTI-GROUP") = "0" Then
| Err.Clear
|
| Set fp_conn = Server.CreateObject("ADODB.Connection")
| FP_DumpError strErrorUrl, "Cannot create connection"
|
| Set fp_rs = Server.CreateObject("ADODB.Recordset")
| FP_DumpError strErrorUrl, "Cannot create record set"
|
| fp_conn.Open Application("Safety_ConnectionString")
| FP_DumpError strErrorUrl, "Cannot open database"
|
| fp_rs.Open """Cuentas Usuarios""", fp_conn, 1, 3, 2 ' adOpenKeySet,
| adLockOptimistic, adCmdTable
| FP_DumpError strErrorUrl, "Cannot open record set"
|
| fp_rs.AddNew
| FP_DumpError strErrorUrl, "Cannot add new record set to the database"
| Dim arFormFields0(2)
| Dim arFormDBFields0(2)
| Dim arFormValues0(2)
|
| arFormFields0(0) = "username"
| arFormDBFields0(0) = "username"
| arFormValues0(0) = Request("username")
| arFormFields0(1) = "password"
| arFormDBFields0(1) = "password"
| arFormValues0(1) = Request("password")
|
| FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0
|
|
| fp_rs.Update
| FP_DumpError strErrorUrl, "Cannot update the database"
|
| fp_rs.Close
| fp_conn.Close
|
| Session("FP_SavedFields")=arFormFields0
| Session("FP_SavedValues")=arFormValues0
| Session.CodePage = Session("FP_OldCodePage")
| Session.LCID = Session("FP_OldLCID")
| Response.Redirect "Logged_in.asp"
|
| End If
| End If
|
| Session.CodePage = Session("FP_OldCodePage")
| Session.LCID = Session("FP_OldLCID")
|
| %>
| <%@ Language=VBScript %><html>
|
| <head>
| <meta name="VI60_defaultClientScript" content="VBScript">
| <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
| <meta name="ProgId" content="FrontPage.Editor.Document">
| <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
| <title>Impact Safety Analysis - Log In to System</title>
| <meta name="Microsoft Theme" content="pixel 011, default">
| </head>
|
| <body background="_themes/pixel/pixbkgnd.gif" bgcolor="#FFFFFF"
| text="#000000" link="#6666CC" vlink="#999999"
| alink="#663333"><!--mstheme--><font face="arial, Arial, Helvetica">
| <form BOTID="0" METHOD="POST" action="Log%20In.asp"
| webbot-action="--WEBBOT-SELF--">
| <!--webbot bot="SaveDatabase" SuggestedExt="asp" S-DataConnection="Safety"
| S-RecordSource="Cuentas Usuarios" U-Confirmation-Url="Logged_in.asp"
| U-Validation-Error-Url="login_failed.asp" S-Form-Fields="username password"
| S-Form-DBFields="username password" U-ASP-Include-Url="_fpclass/fpdbform.inc"
| startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include
| file="_fpclass/fpdbform.inc"--><!--webbot bot="SaveDatabase"
| i-checksum="40548" endspan --><p style="margin-top: 0; margin-bottom: 0"> </p>
| <!--mstheme--></font><table BORDER="0">
| <tr>
| <td><!--mstheme--><font face="arial, Arial,
| Helvetica"><b>username</b><!--mstheme--></font></td>
| <td><!--mstheme--><font face="arial, Arial, Helvetica"><input
| NAME="username" size="20"><!--mstheme--></font></td>
| </tr>
| <tr>
| <td><!--mstheme--><font face="arial, Arial,
| Helvetica"><b>password</b><!--mstheme--></font></td>
| <td><!--mstheme--><font face="arial, Arial, Helvetica">
| <p style="margin-top: 0; margin-bottom: 0">
| <input TYPE="password" NAME="password"
| size="20"><!--mstheme--></font></td>
| </tr>
| </table><!--mstheme--><font face="arial, Arial, Helvetica">
| <p style="margin-top: 0; margin-bottom: 0"> </p>
| <p style="margin-top: 0; margin-bottom: 0">
| <!--webbot bot="SaveAsASP" clientside suggestedext="asp" preview=" "
| startspan --><!--webbot bot="SaveAsASP" endspan --><input TYPE="submit"
| name="LogIn" value="Log In"></p>
| </form>
| <!--webbot bot="DatabaseRegionStart" s-columnnames="username,password"
| s-columntypes="202,202" s-dataconnection="Safety" b-tableformat="FALSE"
| b-menuformat="FALSE" s-menuchoice="username" s-menuvalue="username"
| b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE"
| b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="TRUE"
| s-recordsource="Cuentas Usuarios" s-displaycolumns="username,password"
| s-criteria="[username] EQ {username} + [password] EQ {password} +" s-order
| s-sql="SELECT * FROM &quot;Cuentas Usuarios&quot; WHERE (username =
| '::username::' AND password = '::password::')" b-procedure="FALSE"
| clientside suggestedext="asp"
| s-defaultfields="username=test&amp;password=test" s-norecordsfound="No
| récords existentes." i-maxrecords="256" i-groupsize="0" botid="0"
| u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc"
| u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="BODY" preview="<table border=0
| width="100%"><tr><td bgcolor="#FFFF00" align="left"><font
| color="#000000">This is the start of a Database Results region. The page must
| be fetched from a web server with a web browser to display correctly; the
| current web is stored on your local disk or
| network.</font></td></tr></table>" b-WasTableFormat="FALSE" startspan
| --><!--#include file="_fpclass/fpdblib.inc"-->
| <% if 0 then %>
| <SCRIPT Language="JavaScript">
| document.write("<div style='background: yellow; color: black;'>The Database
| Results component on this page is unable to display database content. The
| page must have a filename ending in '.asp', and the web must be hosted on a
| server that supports Active Server Pages.</div>");
| </SCRIPT>
| <% end if %>
| <%
| fp_sQry="SELECT * FROM ""Cuentas Usuarios"" WHERE (username =
| '::username::' AND password = '::password::')"
| fp_sDefault="username=test&password=test"
| fp_sNoRecords="No récords existentes."
| fp_sDataConn="Safety"
| fp_iMaxRecords=256
| fp_iCommandType=1
| fp_iPageSize=0
| fp_fTableFormat=False
| fp_fMenuFormat=False
| fp_sMenuChoice="username"
| fp_sMenuValue="username"
| fp_iDisplayCols=2
| fp_fCustomQuery=False
| BOTID=0
| fp_iRegion=BOTID
| %>
| <!--#include file="_fpclass/fpdbrgn1.inc"-->
| <!--webbot bot="DatabaseRegionStart" endspan --><p><b>
| username:</b>&nbsp;<!--webbot bot="DatabaseResultColumn"
| s-columnnames="username,password" s-column="username" b-tableformat="FALSE"
| b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font
| size="-1">&lt;&lt;</font>username<font size="-1">&gt;&gt;</font>" startspan
| --><%=FP_FieldVal(fp_rs,"username")%><!--webbot bot="DatabaseResultColumn"
| endspan --></p>
| <p><b>password:</b> <!--webbot bot="DatabaseResultColumn"
| s-columnnames="username,password" s-column="password" b-tableformat="FALSE"
| b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font
| size="-1">&lt;&lt;</font>password<font size="-1">&gt;&gt;</font>" startspan
| --><%=FP_FieldVal(fp_rs,"password")%><!--webbot bot="DatabaseResultColumn"
| endspan --></p>
| <!--msthemeseparator--><p align="center"><img
| src="_themes/pixel/apixrule.gif" width="600" height="10"></p>
| <!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE"
| b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0"
| clientside tag="BODY" preview="<table border=0 width="100%"><tr><td
| bgcolor="#FFFF00" align="left"><font color="#000000">This is the end of a
| Database Results region.</font></td></tr></table>" startspan --><!--#include
| file="_fpclass/fpdbrgn2.inc"-->
| <!--webbot bot="DatabaseRegionEnd" endspan
| --><!--mstheme--></font></body></html>
|
 
A

Aya

What you mean by that so I can understand it better. Do I have to remove it
in the HTML coding?
 
S

Stefan B Rusynko

You need to rename your DB (to remove spaces) and then correct your DB connection
- best done by deleting the current DB and File importing the new DB (so FP can create a new DB connection in global.asa

Yes you rename your .asp pages in Folder list and then adjust any scripts using the file names in code view
--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| What you mean by that so I can understand it better. Do I have to remove it
| in the HTML coding?
|
| "Stefan B Rusynko" wrote:
|
| > Start by Removing all spaces from your DB tables (Cuentas Usuarios) and ASP action pages (Log In.asp)
|
 
A

Aya

Here's another log in coding I've founded on internet, and still no result
using this one.

<html>

<%
'First we create a connection object
Set Conn = Server.CreateObject("ADODB.Connection")

'Next, we open the connection object by calling the connection string
'that FrontPage created and stored in the global.asa file when the "store"
'connection was created
Conn.Open Application("store_ConnectionString")

'Then we create a record set object and a SQL statement
Set RS = Conn.Execute ("SELECT * From Usuarios WHERE username = '" &
Request.Form("username")
& "' AND password = '" & Request.Form("password") & "'")

'Loop through the database to check for the users information
Do until RS.EOF
Pass = RS("Password")
Name = RS("username")
RS.MoveNext
loop

'Close the recordset and database connection
RS.Close
Conn.Close

'If the password given is not in the database then we don't do anything.
'Otherwise, we create the session objects
IF password = "" Then
Message = "The Password you entered is either wrong or not found in our
database. Please press the BACK button and try again."
Else
Session("Password") = Pass
Session("username") = Name

'Now we will check to see it there is a session object for an original URL.
'This would have been created (as you will see later) if the user first tried
'to visit a protected page. If so, we send them there. If not, we stay here.
IF Session("Ori_URL") = "" Then 'do nothing
Else
Response.redirect(session("Ori_URL"))
End IF
End IF
%>

</head>

<body>

<% IF Message = "" Then %>
<table width="60%">
<tr>
<td width="100%"><b><font face="Arial">Usted está conectado como:
<%=FP_FieldVal(fp_rs,"username")%> </font></b><p>
<b><font face="Arial">Por favor, seleccione una página a ir:</font></b></p>
<p>&nbsp; > <a href="Protected.asp">Protected.asp </a></td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>
<% Else %>
<table width="60%">
<tr>
<td width="100%"><Response.Write Message %></td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>
<% End IF %>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Impact Safety Analysis - Log In</title>
<p> </p>

</body>

</html>


I've removed the spaces from my database and on all asp action pages, like
you've said stefan.

Any recommendations, let me know.
 
S

Stefan B Rusynko

Try

<%
Name = Request.Form("username")
Pass = Request.Form("password")
IF Name = "" OR Pass = "" Then
Message = "You must Enter a Username and Password in the login form. Please press the BACK button and try again."
Else
Set Conn = Server.CreateObject("ADODB.Connection")
Set RS = = Server.CreateObject("ADODB.Recordset")
Conn.Open Application("store_ConnectionString")
strSQL = "SELECT * From Usuarios WHERE username='" & Name & "' AND password='" & Pass & "'"
RS.Open strSql, Conn
If RS.EOF Then
Message = "The Password you entered is either wrong or not found in our database. Please press the BACK button and try again."
RS.Close
Conn.Close
Else
Pass = RS("Password")
Name = RS("username")
RS.Close
Conn.Close
Session("Password") = Pass
Session("username") = Name
'below will only work if you have set Session("Ori_URL") from some other page
IF Session("Ori_URL") <> "" Then Response.redirect Session("Ori_URL")
End IF
End If
%>
<html><head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Impact Safety Analysis - Log In</title>
</head>
<body>
<% IF Message = "" Then %>
<table width="60%"><tr>
<td width="100%"><b><font face="Arial">Usted está conectado como: <%=Session("username")%> </font></b>
<p><b><font face="Arial">Por favor, seleccione una página a ir:</font></b></p>
<p><a href="Protected.asp">Protected.asp </a></p></td>
</tr></table>
<% Else %>
<table width="60%"><tr>
<td width="100%"><%=Message%></td>
</tr></table>
<% End IF %>
</body></html>


_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| Here's another log in coding I've founded on internet, and still no result
| using this one.
|
| <html>
|
| <%
| 'First we create a connection object
| Set Conn = Server.CreateObject("ADODB.Connection")
|
| 'Next, we open the connection object by calling the connection string
| 'that FrontPage created and stored in the global.asa file when the "store"
| 'connection was created
| Conn.Open Application("store_ConnectionString")
|
| 'Then we create a record set object and a SQL statement
| Set RS = Conn.Execute ("SELECT * From Usuarios WHERE username = '" &
| Request.Form("username")
| & "' AND password = '" & Request.Form("password") & "'")
|
| 'Loop through the database to check for the users information
| Do until RS.EOF
| Pass = RS("Password")
| Name = RS("username")
| RS.MoveNext
| loop
|
| 'Close the recordset and database connection
| RS.Close
| Conn.Close
|
| 'If the password given is not in the database then we don't do anything.
| 'Otherwise, we create the session objects
| IF password = "" Then
| Message = "The Password you entered is either wrong or not found in our
| database. Please press the BACK button and try again."
| Else
| Session("Password") = Pass
| Session("username") = Name
|
| 'Now we will check to see it there is a session object for an original URL.
| 'This would have been created (as you will see later) if the user first tried
| 'to visit a protected page. If so, we send them there. If not, we stay here.
| IF Session("Ori_URL") = "" Then 'do nothing
| Else
| Response.redirect(session("Ori_URL"))
| End IF
| End IF
| %>
|
| </head>
|
| <body>
|
| <% IF Message = "" Then %>
| <table width="60%">
| <tr>
| <td width="100%"><b><font face="Arial">Usted está conectado como:
| <%=FP_FieldVal(fp_rs,"username")%> </font></b><p>
| <b><font face="Arial">Por favor, seleccione una página a ir:</font></b></p>
| <p>&nbsp; > <a href="Protected.asp">Protected.asp </a></td>
| </tr>
| </table>
| </center>
| </div>
| </td>
| </tr>
| </table>
| <% Else %>
| <table width="60%">
| <tr>
| <td width="100%"><Response.Write Message %></td>
| </tr>
| </table>
| </center>
| </div>
| </td>
| </tr>
| </table>
| <% End IF %>
|
| <head>
| <meta http-equiv="Content-Language" content="en-us">
| <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
| <meta name="ProgId" content="FrontPage.Editor.Document">
| <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
| <title>Impact Safety Analysis - Log In</title>
| <p> </p>
|
| </body>
|
| </html>
|
|
| I've removed the spaces from my database and on all asp action pages, like
| you've said stefan.
|
| Any recommendations, let me know.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top