%Option Explicit On Error Resume Next%>
The form you submitted is incomplete. Click here " & _ "or use your back button to return to the sign up page. Fill in all fields marked with an asterisk(*).
") Else 'create records 'open database connection and insert new partner record Dim conec, nextID, recSet set conec = Server.CreateObject("ADODB.Connection") conec.ConnectionString = "Password=airfrance2;Data Source=Contacts" conec.open 'check that new record is not duplicate of old records Dim duplicate, fnameTemp, lnameTemp, emailTemp, phoneTemp, addressTemp, cityTemp If fname = "" Then fnameTemp = " is null" If(fnameTemp <> " is null") Then fnameTemp = " = '" & fname & "'" If lname = "" Then lnameTemp = " is null" If(lnameTemp <> " is null") Then lnameTemp = " = '" & lname & "'" If email = "" Then emailTemp = " is null" If(emailTemp <> " is null") Then emailTemp = " = '" & email & "'" If phone = "" Then phoneTemp = " is null" If(phoneTemp <> " is null") Then phoneTemp = " = '" & phone & "'" If address = "" Then addressTemp = " is null" If(addressTemp <> " is null") Then addressTemp = " = '" & address & "'" If city = "" Then cityTemp = " is null" If(cityTemp <> " is null") Then cityTemp = " = '" & city & "'" duplicate = True 'assume true, then check set recSet = Server.CreateObject("ADODB.Recordset") recSet.open "select * from People where " & _ "FirstName" & fnameTemp & " and " & _ "LastName" & lnameTemp & " and " & _ "Email" & emailTemp & " and " & _ "Phone" & phoneTemp & " and " & _ "Address" & addressTemp & " and " & _ "City" & cityTemp, conec, 3, 1 If(recSet.RecordCount > 0) Then duplicate = True Else duplicate = False End If recSet.close nextID = conec.execute("select count(*) from People") If(Not(nextID(0) > 2147000000) And Not duplicate) Then 'no more than 2,147,000,000 records in database recSet.open "People", conec, 1, 3 'open for update; non-simultaneous recSet.AddNew If(title <> "") Then recSet("Title") = title End If recSet("FirstName") = fname If(mname <> "") Then recSet("MiddleName") = mname End If recSet("LastName") = lname If(address <> "") Then recSet("Address") = address End If If(city <> "") Then recSet("City") = city End If If(state <> "") Then recSet("State") = state End If If(zip <> "") Then recSet("Zip") = zip End If If(country <> "") Then recSet("Country") = country End If If(email <> "") Then recSet("Email") = email End If If(phone <> "") Then recSet("Phone") = phone End If recSet.Update recSet.close set recSet = nothing %>Thank you for signing up...
Click here if you don't see a new page after a few seconds.
<% Else 'database is full, output message Response.Write("Sorry, cannot process transaction at this time. " & _ "Please try again soon or send inquiry.
") End If conec.close set conec = nothing End If Session.Abandon %>