This is the form:
<FORM name="form1" onsubmit="check()">
<TABLE WIDTH=485 CELLPADDING=2 CELLSPACING=2 BORDER=0>
<TR>
<TD COLSPAN=1 ROWSPAN=1 WIDTH=120></TD>
<TD COLSPAN=1 ROWSPAN=1 WIDTH=365></TD>
</TR>
<TR>
<TD>Login Name</TD>
<TD><INPUT TYPE="TEXT" NAME="LoginName" SIZE="51" MAXLENGTH="40"></TD>
</TR>
<TR>
<TD>Password</TD>
<TD><INPUT TYPE="PASSWORD" NAME="LoginPassword" SIZE="51"
MAXLENGTH="20"></TD>
</TR>
<TR>
<TD HEIGHT=35 COLSPAN=2 ALIGN="CENTER" VALIGN="BOTTOM"><INPUT TYPE="SUBMIT"
NAME="Login" VALUE=" Standard Login "><BR></TD>
</TR>
</TABLE>
</FORM>
This is what it calls to check non-blank fields:
<head>
<title>PerfectaWeb Design - Members Area</title>
<link rel="stylesheet" href="standardpage.css" type="text/css">
<script language="VBScript">
<!-- Activate Cloaking Device
Sub check()
If form1.LoginName.value = "" then
MsgBox "You must enter a UserName"
ElseIf IsNull(form1.LoginPassword.value) then
MsgBox "You must enter a Password"
Else window.open("LoginCheck.asp")
End If
End Sub
-->
</script>
</head>
And then I was going to check against a database:
<%
Dim mySQL
Dim connect_obj
Dim record_obj
' --- this code opens the database ---
set connect_obj=Server.CreateObject("ADODB.Connection")
set record_obj=Server.CreateObject("ADODB.Recordset")
'This works with the SYSTEM DSN
connect_obj.Open "DSN=PasswordSystemDSN"
' --- this code retrieves the data ---
mySQL="SELECT * FROM PasswordTable WHERE (((PasswordTable.UserID)=" &
form1.LoginName.value & "))"
record_obj.Open mySQL, connect_obj
%>
Is this the correct way of going about this? I am having a lot of problems
in getting this to work. The database does not want to connect but will a
few minutes later. Is this a Server thing. I am using NT4 SP5 IIS4. Please
help this is driving me crazy!!!
TIA
Jez
If you do a lot of work in ASP I recommend getting a book on ASP. A good one
is Beginning Active Server Pages 2.0 by Wrox Press. You really need to
understand what is running on the server and what runs on the client. The
sub check will run on the client (the browser) but the database code will
run on the server. This means if you need client input values in your
server code then you will have to have the client submit a form and then
access those form variables using request("FormVarName") format.
Jeremy Bassett <j...@perfecta-computr.demon.co.uk> wrote in message
news:948849694.17690.0...@news.demon.co.uk...