<%@ LANGUAGE="VBSCRIPT" %> Hometown Bank

Hometown Bank

<% Dim name Name = CStr(Request.form("name")) Dim password password = CStr(Request.form("password")) Dim amount amount = CDbl(Request.form("amount")) Dim deposit deposit = CStr(Request.form("Deposit")) Dim withdraw withdraw = CStr(Request.form("Withdraw")) Dim objConn Set objConn = Server.CreateObject("ADODB.Connection") objConn.ConnectionString = "DSN=database01" objConn.Open Dim objRS Set objRS = Server.CreateObject("ADODB.Recordset") Dim namestring namestring="'" & Name & "'" passwordstring="'" & Password & "'" set dennis=objConn.execute("use bank") mySQL="select * from hometown where username=" & namestring & " and password=" & passwordstring set rstemp=objConn.execute(mySQL) if rstemp.eof then response.Write("

Sorry, invalid userid or password ") %>

<% else Response.Write("

Hi " & name &"") Dim balance balance=rstemp("balance") if isnumeric(amount) then ' do nothing else amount=0.0 end if if deposit="Deposit" then response.write("

$" & amount & " deposited") balance=balance + amount end if if withdraw="Withdraw" then response.write("

$" & amount & " withdrawn") balance=balance - amount end if Response.Write("

Balance $: " & balance & "") Dim balancestring balancestring="'" & balance & "'" Dim UpdateSQL UpdateSQL="update hometown set balance=" & balance & " where " & " username=" & namestring & " and " & " password=" & passwordstring rstemp=objConn.execute(UpdateSQL) %>

> > Enter Amount:

<% end if %>