% @LANGUAGE="VBScript" %> <% Option Explicit %> <% 'page settings const progressWidth=1 const hidePrev=true const hideSave=true const hideNext=false dim applicationID, subPage, submitButton, prevPage, nextPage dim conn, rst, SQLquery, unique dim timeNow, dateNow if request.querystring("fn")="go" then ' Form submitted - check which button was pressed submitButton = request.form("submitButton") if submitButton="Next" then 'new application - add to db timeNow = time() dateNow = date() 'generate a random applicationID - repeat until we find one that's not in the database randomize() unique = false set conn = Server.CreateObject("ADODB.connection") set rst = Server.CreateObject("ADODB.recordset") conn.Open strConnection do while not unique applicationID = Int(99999999 * Rnd()) SQLquery = "SELECT ID FROM tblApplications WHERE applicationID=" & applicationID & ";" rst.open SQLquery, conn, 0, 1 if rst.EOF and rst.BOF then unique=true else unique=false end if rst.close loop SQLquery = "INSERT INTO tblApplications (applicationID, startDateTime) VALUES (" & applicationID & ",#" & formatDateTime(dateNow, 1) & " " & formatDateTime(timeNow, 3) & "#);" conn.execute(SQLquery) conn.close set rst=nothing set conn=nothing 'move onto the next page nextPage = "01-type.asp?" response.redirect(nextPage & "applicationID=" & applicationID) end if else applicationID=0 end if %>
Arnold Commercial Finance Ltd - Online Application Form
Tel: 0845 6022 183 - Fax:0845 6031 871
E-mail:chris@arnold-cf.co.uk
- Web: www.arnold-cf.co.uk