Skeen
Aug 30th, 2000, 05:41 AM
Hiya everybody ("Hi Dr Nick....em Dr Skeen!"),
I'm using oracle on NT for my database, and am embedding VBscript inside html for the front end ( checking Usr/Password etc). I've been scouting through a few books but as yet have had no joy!
After a user has submitted username and password, once authenticated within the database I want the Vb script to direct the user to the main menu page. On clicking the submit button, that opens the connection to the database for usr/password validation but after that I don't know what to do! Any help would be greatly appreciated, my code is below ("standard" - he he, just a little computer humor - sorry, I'll get my coat)
Cheers 'n' Beers
Skeen
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title>Acquist Accounts</title>
</head>
<script language = "vbscript">
function Get_Username
Dim cnAcqAcc
Dim cmAcqAcc
Dim rsUserPassword
Dim cmSQL
Dim StoredPassword
'On Error Resume Next
Set cnAcqAcc = CreateObject ( "ADODB.Connection" )
cnAcqAcc.ConnectionString = "Provider=MSDASQL;DSN=AqAc;UID=AcqAcc_owner;PWD=AcqAcc_owner;"
cnAcqAcc.open
User = document.frm1.T1.value
MsgBox User
Pass = document.frm1.T2.value
MsgBox Pass
cmSQL= "SELECT Password FROM UserPassword WHERE Username = '" & User & "' "
Set rsUserPassword = cnAcqAcc.Execute( cmSQL )
rsUserPassword.MoveFirst
StoredPassword =rsUserPassword( "Password" )
cnAcqAcc.Close
Set rsCatagory = Nothing
If StoredPassword = Pass Then
MsgBox "Logged On"
'execute "Main_menu_test.html"
ElseIf StoredPassword <> Pass Then
MsgBox "Get Stuffed"
End if
End function
</script>
<body bgcolor="#FFFFFF">
<p> </p>
<p> </p>
<p align="center"><font size="7"><strong>Acquist Accounts</strong></font></p>
<hr size="12" noshade color="#808000">
<p> </p>
<p><font color="#000000" size="4">Welcome to Acquist Accounts
database. Please enter your Username and Password then click
submit to access your account details. Use the mouse to click
into the username field and then tab or click into the password
field, then click submit. You can reset the page by clicking
reset.</font></p>
<p> </p>
<form method="POST" onSubmit="Get_Username" name=frm1 >
<p><font size="4">Enter Username: </font><input type="text" size="20" name="T1"></p>
<p><font size="4">Enter Password: </font><input type="password" size="20" name="T2"></p>
<p><input type="submit" name="B1" value="Submit" > <input type="reset" name="B2" value="Reset"></p>
</form>
</body>
</html>
I'm using oracle on NT for my database, and am embedding VBscript inside html for the front end ( checking Usr/Password etc). I've been scouting through a few books but as yet have had no joy!
After a user has submitted username and password, once authenticated within the database I want the Vb script to direct the user to the main menu page. On clicking the submit button, that opens the connection to the database for usr/password validation but after that I don't know what to do! Any help would be greatly appreciated, my code is below ("standard" - he he, just a little computer humor - sorry, I'll get my coat)
Cheers 'n' Beers
Skeen
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title>Acquist Accounts</title>
</head>
<script language = "vbscript">
function Get_Username
Dim cnAcqAcc
Dim cmAcqAcc
Dim rsUserPassword
Dim cmSQL
Dim StoredPassword
'On Error Resume Next
Set cnAcqAcc = CreateObject ( "ADODB.Connection" )
cnAcqAcc.ConnectionString = "Provider=MSDASQL;DSN=AqAc;UID=AcqAcc_owner;PWD=AcqAcc_owner;"
cnAcqAcc.open
User = document.frm1.T1.value
MsgBox User
Pass = document.frm1.T2.value
MsgBox Pass
cmSQL= "SELECT Password FROM UserPassword WHERE Username = '" & User & "' "
Set rsUserPassword = cnAcqAcc.Execute( cmSQL )
rsUserPassword.MoveFirst
StoredPassword =rsUserPassword( "Password" )
cnAcqAcc.Close
Set rsCatagory = Nothing
If StoredPassword = Pass Then
MsgBox "Logged On"
'execute "Main_menu_test.html"
ElseIf StoredPassword <> Pass Then
MsgBox "Get Stuffed"
End if
End function
</script>
<body bgcolor="#FFFFFF">
<p> </p>
<p> </p>
<p align="center"><font size="7"><strong>Acquist Accounts</strong></font></p>
<hr size="12" noshade color="#808000">
<p> </p>
<p><font color="#000000" size="4">Welcome to Acquist Accounts
database. Please enter your Username and Password then click
submit to access your account details. Use the mouse to click
into the username field and then tab or click into the password
field, then click submit. You can reset the page by clicking
reset.</font></p>
<p> </p>
<form method="POST" onSubmit="Get_Username" name=frm1 >
<p><font size="4">Enter Username: </font><input type="text" size="20" name="T1"></p>
<p><font size="4">Enter Password: </font><input type="password" size="20" name="T2"></p>
<p><input type="submit" name="B1" value="Submit" > <input type="reset" name="B2" value="Reset"></p>
</form>
</body>
</html>