Skeen
Aug 21st, 2000, 03:25 AM
Hi Y'all
I'm trying to logon to a database using VBscript inside html. The problem I'm having is that the username and password I input at the html screen is not being inserted into the VBscript.
Secondly the reconciliation between the stored username and password fom the database, and the values input dosn't seem to happen.
If anyone can see what wrong with my code I'd appreciate the help. My code is below:
Cheers 'n' beers<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 AcqAcc
On Error Resume Next
' create the connection object
Set AcqAcc = CreateObject ( "ADODB.Connection" )
' Set the connection string
AcqAcc.ConnectionString = "Provider=MSDASQL;DSN=Acquist_Accounts;UID=internal;PWD=oracle;"
AcqAcc.open
' get data from logon_page and check against UserPassword table in the database
Set User = document.T1
MsgBox User
Set Pass = document.T2
MsgBox Pass
' check username & password
Set CheckUsername = AcqAcc.Execute( "SELECT USERNAME FROM UserPassword WHERE PASSLEVEL = 7" )
Set CheckPassword = AcqAcc.Execute( "SELECT PASSWORD FROM UserPassword WHERE PASSLEVEL = 7" )
If CheckUsername = User AND CheckPassword = Pass Then
MsgBox "Logged on"
Else MsgBox "Get Stuffed"
End if
' close and destroy the connection object
AcqAcc.Close
Set AcqAcc = Nothing
' MsgBox err.Description
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">
<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 trying to logon to a database using VBscript inside html. The problem I'm having is that the username and password I input at the html screen is not being inserted into the VBscript.
Secondly the reconciliation between the stored username and password fom the database, and the values input dosn't seem to happen.
If anyone can see what wrong with my code I'd appreciate the help. My code is below:
Cheers 'n' beers<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 AcqAcc
On Error Resume Next
' create the connection object
Set AcqAcc = CreateObject ( "ADODB.Connection" )
' Set the connection string
AcqAcc.ConnectionString = "Provider=MSDASQL;DSN=Acquist_Accounts;UID=internal;PWD=oracle;"
AcqAcc.open
' get data from logon_page and check against UserPassword table in the database
Set User = document.T1
MsgBox User
Set Pass = document.T2
MsgBox Pass
' check username & password
Set CheckUsername = AcqAcc.Execute( "SELECT USERNAME FROM UserPassword WHERE PASSLEVEL = 7" )
Set CheckPassword = AcqAcc.Execute( "SELECT PASSWORD FROM UserPassword WHERE PASSLEVEL = 7" )
If CheckUsername = User AND CheckPassword = Pass Then
MsgBox "Logged on"
Else MsgBox "Get Stuffed"
End if
' close and destroy the connection object
AcqAcc.Close
Set AcqAcc = Nothing
' MsgBox err.Description
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">
<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>