ASP File
Map
3/12/2000

contactsUpdateLocation (3) contactsUpdateContact (8)


contactsInsertLocation
(4) contactsUpdateLocation2 (6) contactsInsertContact (9) contactsModifyContact (11)
![]()
![]()
![]()
contactsInsertLocation2
(5) contactsModifyLocation (7) contactsInsertContact2 (10)
<%@ language=vbscript%>
<html>
<head>
<meta NAME= “GENERATOR” Content= “Microsoft Visual Studio 6.0”>
<link rel= “stylesheet” type= “text/css” href= “css/moet.css”>
<title></title>
</head>
<body>
<form name=contactsUpdate.asp method=Post
action=contactsUpdate2.asp>
<p align= “center”> <b> Update MOET Contact List
</p>
<%
dim connMoetConnection
set connMoetConnection = Server.CreateObject (“ADODB.Connection”)
connMoetConnection.open “provider = Microsoft.Jet.OLEDB.4.0;
data source =
d:inetpub\wwwroot\mdb\img.mdb;”
SQLQueryRegion = “SELECT DISTINCT Region FROM tblMOETContactList”
Set Regions = connMoetConnection.Execute (SQLQueryRegion)
%>
<SELECT align= “center” name= “cboRegion” id=cboRegion >
<option selected value= “”>
SELECT REGION
<%
Do Until REGIONS.EOF
= True
%>
<option><%=
REGIONS(“Region”)%> </option>
<%
REGIONS.MoveNext
Loop
%>
</SELECT>
<input type= “submit” value= “Continue” id= button1 name=
“button1”>
</form>
</font>
</body>
</html>
<%@ language=vbscript%>
<html>
<head>
<meta NAME= “GENERATOR” Content= “Microsoft Visual Studio 6.0”>
<link rel= “stylesheet” type= “text/css” href= “css/moet.css”>
<title></title>
<SCRIPT ID= clientEventHandlersVBS LANGUAGE= vbscript>
<!--
Sub cmdContacts_onclick
contactsUpdate2.cmdContacts.style.visibility= “hidden”
End Sub
-->
</SCRIPT>
</head>
<body>
<form name=contactsUpdate2.asp method=Post
action=contactsUpdateContact.asp>
<p align= “center”> <b> Update MOET Contact List
</b> <br> <br>
<%
dim strRegion
dim Connection
strRegion = Request.Form(“cboRegion”)
Set Connection = Server.CreateObject(“ADODB.Connection”)
Connection.Open “provider=Microsoft.Jet.OLEDB.4.0; data source=
d:inetpub\wwwroot\mdb\img.mdb;”
SQLQueryLocation = “SELECT DISTINCT SalesLocation FROM
tblMOETContactList WHERE
Region = ‘” &
strRegion & “’ ORDER BY SalesLocation”
Set Locations = Connection.Execute(SQLQueryLocation)
If Request.Form(“cboRegion”) = “” then
Response.Write
(“Press your browser’s Back button and select a Region to continue.”)
CboLocation.disabled
= “True”
End if
%>
<p align= “center”>  
Region: <INPUT value = “<%=strRegion%>” size=10 id=showRegion name=showRegion
Style=.border=none
style=.font=bold readonly>
<br><br>
<INPUT type= “button” value= “Add or Edit Contact Information”
id=cmdContacts name=cmdContacts>
<br>
<INPUT type= “text” style= “BORDER-STYLE: none; FONT-SIZE: small”
style= “visibility: hidden” size=65 id=text1 name=text1
value= “To edit
contact information, select their location and click Continue.”> <br> <br>
<SELECT name=cboLocation id=cboLocation style= “visibility:
hidden”>
<option selected value= “”> SELECT Sales Location
<%
Do Until
Locations.EOF = True
%>
<option><%= Locations(“SalesLocation”)%> </option>
<%
Locations.Movenext
Loop
%>
</select>
<%
Session(“showRegion”) = strRegion
Session(“showLocation”) = cboLocation
%>
<input type = “submit” value= “Continue” id= “cmdContinue” name=
“cmdContinue” style= “visibility: hidden”>
<br><br><br><br>
<FONT size=3> <a href= “http://wwopsdev/wwops_img/img/moet/contactsUpdateLocation.asp”>
Click
Here To Add or Edit a Sales Location </a></font> </p>
<br><br>
<p align=center> <FONT size=2>
<a href= “http://wwopsdev/wwops_img/img/moet/contactsUpdate.asp”>
START
OVER </a> </font> </p> <br>
</form> </font> </body> </html>
<%@ language=vbscript%>
<html>
<head>
<meta NAME= “GENERATOR” Content= “Microsoft Visual Studio 6.0”>
<link rel= “stylesheet” type= “text/css” href= “css/moet.css”>
<title></title>
</head>
<body>
<form name=contactsUpdateLocation.asp method=Post
action=contactsUpdateLocation2.asp>
<p align= “center”> <b> Update MOET Contact List
</b> <br><br>
<%
dim strRegion
dim Connection
strRegion = Session(“showRegion”)
Set Connection = Server.CreateObject(“ADODB.Connection”)
Connection.Open “provider=Microsoft.Jet.OLEDB.4.0;data source=
d:inetpub\wwwroot\mdb\img.mdb;”
SQLQueryLocation= “SELECT DISTINCT SalesLocation FROM
tblMOETContactList WHERE
Region = ‘” &
strRegion & “’ ORDER BY SalesLocation”
Set Locations = Connection.Execute(SQLQueryLocation)
%>
<p align=center>
Region: <INPUT value= “<%=strRegion%> size=10 id=showRegion
name=showRegion
style=.border=none
style=.font=bold readonly>
<br><br>
<INPUT type= “text” style= “BORDER-STYLE: none; FONT-SIZE: small”
size=60 id=text1 name=text1
value= “To edit a
Sales Location, select the location and click Continue.”> <br><br>
<SELECT name= cboLocation id= cboLocation>
<option selected value= “”> Select Sales Location
<%
Do Until
Locations.EOF = True
%>
<option><%= Locations(“SalesLocation”)%>
</option>
<%
Locations.MoveNext
Loop
%>
</select>
<%
Session(“showLocation”)= cboLocation
Session(“showRegion”)= strRegion
%>
<p align=center>
<input type= “submit” value= “Continue” id=cmdContinue
name=cmdContinue>
<FONT size=4> <br><br> OR
<br><br>
<FONT size=3> <a href= “http://wwopsdev/wwops_img/img/moet/contactsInsertLocation.asp”>
Click
Here To Add a Sales Location
</a>
</font> </p> <br><br>
<p align=center>
<FONT size=2> <a href= “http://wwopsdev/wwops_img/img/moet/contactsUpdate.asp”>
START
OVER
</a>
</font> </p>
</form>
</font>
</body>
</html>
<%@ language=vbscript%>
<html>
<head>
<meta NAME= “GENERATOR” Content= “Microsoft Visual Studio 6.0”>
<link rel= “stylesheet” type= “text/css” href= “css/moet.css”>
<title></title>
</head>
<body>
<form name=contactsInsertLocation.asp method=Post
action=contactsInsertLocation2.asp>
<p align= “center”> <b> Update MOET Contact List
</b> <br><br>
<%
dim strRegion
dim NewID
strRegion = Session(“showRegion”)
Set Connection = Server.CreateObject(“ADODB.Connection”)
Connection.Open “provider=Microsoft.Jet.OLEDB.4.0;data source=
d:inetpub\wwwroot\mdb\img.mdb;”
SQLQueryID= “SELECT DISTINCT ID FROM tblMOETContactList”
Set IDNumbers = Connection.Execute(SQLQueryID)
SQLQueryTitles = “SELECT DISTINCT Title FROM tblMOETContactList WHERE
Region = ‘” &
strRegion & “’ ORDER BY Title”
Set Titles = Connection.Execute(SQLQueryTitles)
NewID = 1
Do Until
IDNumbers.EOF = True
NewID = NewID + 1
IDNumbers.MoveNext
Loop
%>
<p align=center> <b>Add to MOET Contact List </b>
Region: <INPUT value= “<%=strRegion%>” id=showRegion
name=showRegion size=5
style=.border=none
style=.font=bold readonly>
<br><br>
New Location: <INPUT id=newLocation name=newLocation
style=.font=bold>
</b></p>
<table align=center>
<%
Do Until Titles.EOF =
True
%>
<tr><td><INPUT
value= “<%=Titles(“Title”)%>”
style=.visibility=hidden
id=txtTitle name=txtTitle readonly>
<%
Titles.MoveNext
%>
<td><INPUT
value= “<%=NewID%>”
style=.visibility=hidden
id=txtID name=txtID readonly>
<%
NewID
= NewID + 1
%>
<%
Loop
%>
</table>
<p align=center><b>
<INPUT id=cmdUpdate name=cmdUpdate type=submit
value= “ Add “>
</b>
<br><br>
<FONT size=2> <a href= “http://wwopsdev/wwops_img/moet/contactsUpdate.asp”>
START OVER </a>
</font>
</p>
</form>
</body>
</html>
<%@ language=vbscript%>
<html>
<head>
<meta NAME= “GENERATOR” Content= “Microsoft Visual Studio 6.0”>
<link rel= “stylesheet” type= “text/css” href= “css/moet.css”>
<title></title>
</head>
<body>
<form name=contactsInsertLocation2.asp method=Post
action=contactsUpdate.asp>
<p align= “center”> <b> <br><br><br>
<%
‘Error trapping
dim ItsAllGood
dim Incomplete
ItsAllGood = “True”
Incomplete = “False
‘Trap if user doesn’t enter a new location
If Request.Form(“newLocation”) = “” then Incomplete = “True”
If Incomplete = “True” then
Response.Write(“Enter
the New Location name.”)
%>
<br><br>
<%
Response.Write(“Use
your browser’s Back button and complete the form.”)
ItsAllGood = “False”
End if
‘Trap if user enters form illegally
If Request.Form.Count <= 0 then
Response.Write(“You have
entered this form incorrectly.
This page is only accessible from the
contactsUpdateContact.asp page.”)
ItsAllGood = “False”
End if
If ItsAllGood = “True” then
Call WriteRecord
End if
%>
<%
sub WriteRecord
dim strInsertSql
dim commandObject
dim n
set Connection =
Server.CreateObject(“ADODB.Connection”)
Connection.open
“provider=Microsoft.Jet.OLEDB.4.0;
data source=
d:inetpub\wwwroot\mdb\img.mdb;”
set commandObject =
Connection
for n = 1 to
Request.Form(“txtID”).Count
strInsertSql
= “INSERT INTO tblMOETContactList values(“
strInsertSql
= strInsertSql + “’” + Request.Form(“txtID”)(n) + “’,”
strInsertSql
= strInsertSql + “’” + Session(“showRegion”) + “’,”
strInsertSql
= strInsertSql + “’” + Request.Form(“newLocation”) + “’,”
strInsertSql
= strInsertSql + “’” + Request.Form(“txtTitle”)(n) + “’,”
strInsertSql
= strInsertSql + “’” + Request.Form(“txtContact”) + “’,”
strInsertSql
= strInsertSql + “’” + Request.Form(“txtAlias”) + “’,”
‘ (to
view SQL string, remove comment mark from the following line)
‘ Response.Write(strInsertSql)
commandObject.Execute(strInsertSql)
next
Connection.Close
Call
DisplayConfirmation
End sub
%>
<%
sub DisplayConfirmation
Response.Write(“The
new location has been successfully added to the MOET Contact database. ”)
%>
<br><br>
<INPUT
type= “submit” value= “Update Other MOET Contacts and Locations” id=submit1
name=submit1>
<br><br>
<%
Response.Write(“Press
your browser’s Back button to Add or Modify other Sales Locations in this
Region. ”)
%>
<br></p>
<%
end sub
%>
</p>
</form>
</body>
</html>
<%@ language=vbscript%>
<html>
<head>
<meta NAME= “GENERATOR” Content= “Microsoft Visual Studio 6.0”>
<link rel= “stylesheet” type= “text/css” href= “css/moet.css”>
<title></title>
</head>
<body>
<form name=contactsUpdateLocation2.asp method=Post
action=contactsModifyLocation.asp>
<p align= “center”> <br>
<%
dim strRegion
dim strLocation
strRegion = Session(“showRegion”)
strLocation = Request.Form(“cboLocation”)
Set Connection = Server.CreateObject(“ADODB.Connection”)
Connection.Open “provider=Microsoft.Jet.OLEDB.4.0;data source=
d:inetpub\wwwroot\mdb\img.mdb;”
SQLQueryContacts= “SELECT * FROM tblMOETContactList WHERE
SalesLocation = ‘” & strLocation & “’”
Set CONTACT = Connection.Execute(SQLQueryContacts)
SQLQueryTitles = “SELECT DISTINCT Title FROM tblMOETContactList WHERE
Region = ‘” & strRegion
& “’ ORDER BY Title”
%>
<p align=center> <b>Add to MOET Contact List </b>
Region: <INPUT value= “<%=strRegion%>” id=showRegion
name=showRegion size=5
style=.border=none
style=.font=bold readonly>
Old Sales Location Name: <INPUT value= “<%=strLocation%>”
id=showLocation name=showLocation
style=.border=none
style=.font=bold readonly>
<br><br>
New Sales Location Name: <INPUT value= “<%=strLocation%>”
id=newLocation name=newLocation
style=.font=bold >
</p>
<%
Session(“showRegion”) = strRegion
Session(“showLocation”) = strLocation
%>
<br>
<p align=center><FONT size=4> Edit Sales Location name in
the box above, then click “Update”. </font>
<br><b>
<INPUT id=cmdUpdate name=cmdUpdate type=submit value= “ Update
“>
<INPUT id=cmdCancel
name=cmdCancel type=reset value= “ Cancel “>
<FONT size=3> Sales Locations can not be deleted, only changed
above. <br> </font>
<FONT size=2> Please note: Do not include an apostrophe in any
field. <br> <br>
</b>
<a href= “ http://wwopsdev/wwops_img/img/moet/contactsUpdate.asp”>
START OVER </a>
</font>
</p>
</form>
</body>
</html>
<%@ language=vbscript%>
<html>
<head>
<meta NAME= “GENERATOR” Content= “Microsoft Visual Studio 6.0”>
<link rel= “stylesheet” type= “text/css” href= “css/moet.css”>
<title></title>
</head>
<body>
<form name=contactsModifyLocation.asp method=Post
action=contactsUpdate.asp>
<p align= “center”> <b> <br><br><br>
<%
‘Error trapping
dim ItsAllGood
dim Incomplete
ItsAllGood = “True”
Incomplete = “False
‘Trap if user doesn’t enter all information
For n = 1 to Request.Form(“txtName”).Count
If
Request.Form(“txtName”)(n) = “” then
If Request.Form(“txtAlias”)(n) <> “” then
Incomplete
= “True”
End
if
Elseif
Request.Form(“txtName”)(n) <> “” then
If
Request.Form(“txtAlias”)(n) = “” then
Incomplete
= “True”
End
if
End
if
Next
If Request.Form(“newLocation”) = “” then Incomplete = “True”
If Incomplete = “True” then
Response.Write(“Please
enter the new name for this Sales Location.”)
%>
<br><br>
<%
Response.Write(“Use
your browser’s Back button and complete the form.”)
ItsAllGood = “False”
End if
‘Trap if user enters form illegally
If Request.Form.Count <= 0 then
Response.Write(“You
have entered this form incorrectly.
This page is only accessible from the
contactsUpdateContact.asp page.”)
ItsAllGood = “False”
End if
If ItsAllGood = “True” then
Call WriteRecord
End if
%>
<%
sub WriteRecord
dim strInsertSql
dim commandObject
set Connection =
Server.CreateObject(“ADODB.Connection”)
Connection.open
“provider=Microsoft.Jet.OLEDB.4.0;
data source=
d:inetpub\wwwroot\mdb\img.mdb;”
set commandObject =
Connection
strInsertSql =
“UPDATE tblMOETContactList SET “
strInsertSql =
strInsertSql + “tblMOETContactList.SalesLocation= “ + “’” +
Request.Form(“newLocation”)
+ “’”
strInsertSql = strInsertSql
+ “ WHERE tblMOETContactList.SalesLocation= “ + “’” +
Session(“showLocation”)
+ “’”
‘ (to
view SQL string, remove comment mark from the following line)
‘ Response.Write(strInsertSql)
commandObject.Execute(strInsertSql)
Connection.Close
Call
DisplayConfirmation
End sub
%>
<%
sub DisplayConfirmation
Response.Write(“The
MOET Contact database has been successfully updated. ”)
%>
<br><br>
<INPUT
type= “submit” value= “Update Other MOET Contacts and Locations” id=submit1
name=submit1>
<br><br>
<%
Response.Write(“Press
your browser’s Back button to Add or Modify other Sales Locations in this
Region. ”)
%>
<br></p>
<%
end sub
%>
</p>
</form>
</body>
</html>
<%@ language=vbscript%>
<html>
<head>
<meta NAME= “GENERATOR” Content= “Microsoft Visual Studio 6.0”>
<link rel= “stylesheet” type= “text/css” href= “css/moet.css”>
<title></title>
</head>
<body>
<form name=contactsUpdateContact.asp method=Post action=contactsModifyContact.asp>
<p align= “center”> <b> Update MOET Contact List
</b> <br><br>
<%
dim strLocation
dim strRegion
strLocation = Request.Form(“cboLocation”)
strRegion = Session(“showRegion”)
Set Connection = Server.CreateObject(“ADODB.Connection”)
Connection.Open “provider=Microsoft.Jet.OLEDB.4.0;data source=
d:inetpub\wwwroot\mdb\img.mdb;”
SQLQueryContacts= “SELECT * FROM tblMOETContactList WHERE
SalesLocation = ‘” & strLocation & “’”
Set Contact = Connection.Execute(SQLQueryContacts)
SQLQueryTitles = “SELECT DISTINCT Title FROM tblMOETContactList WHERE
Region = ‘” &
strRegion & “’ ORDER BY Title”
If Request.Form(“cboLocation”) = “” then
Response.Write(“Press
your browser’s Back button and select a Sales Location to continue.”)
ShowLocation.disabled
= True
End if
%>
Region: <INPUT value= “<%=strRegion%>” id=showRegion
name=showRegion size=5
style=.border=none
style=.font=bold readonly>
<br><br>
Location: <INPUT value= “<%=strLocation%>” id=showLocation
name=showLocation size=18
style=.border=none
style=.font=bold readonly>
</b></p>
<table align=center>
<tr><th>
<th>Title
<th> MOET Contact
<th> email alias
<%
Do Until Contact.EOF
= True
%>
<tr>
<td><INPUT
size=1 value= “<%=Contact(“ID”)%>”
style=.visibility=hidden
id=txtID name=txtID readonly>
<td><SELECT
id=txtTitle name=txtTitle >
<%
Set Titles = Connection.Execute(SQLQueryTitles)
Do
Until Titles.EOF = True
If
Titles(“Title”) <> Contact(“Title”) then
%><option><%
= Titles(“Title”) %></option><%
Titles.MoveNext
Else
Titles.MoveNext
End
if
Loop
%>
<option
selected> <%= Contact(“Title”)%> </option></select>
<td><INPUT
size=30 value= “<%=Contact(“Contact”)%>” id=txtName name=txtName>
<td><INPUT
size=15 value= “<%=Contact(“Alias”)%>” id=txtAlias name= txtAlias >
<%
Contact.MoveNext
Loop
%>
</table>
<p align=center>
<FONT size=3> <a href= “http://wwopsdev/wwops_img/moet/contactsInsertContact.asp”>
Click
Here To Add a Contact </a> <br> or </font>
<FONT size=4> Edit or delete
contact information above, then click “Update.” </font>
<b>
<INPUT id=cmdUpdate name=cmdUpdate
type=submit value= “ Update ”>
<INPUT id=cmdCancel name=cmdCancel type=reset value= “
Cancel “>
<FONT size=2> Please note: Do not
include an apostrophe in any field. </b>
<br><br>
<a href= “http://wwopsdev/wwops_img/moet/contactsUpdate.asp”>
START
OVER </a>
</font>
</p>
</form>
</body>
</html>
<%@ language=vbscript%>
<html>
<head>
<meta NAME= “GENERATOR” Content= “Microsoft Visual Studio 6.0”>
<link rel= “stylesheet” type= “text/css” href= “css/moet.css”>
<title></title>
</head>
<body>
<form name=contactsInsertContact.asp method=Post
action=contactsInsertContact2.asp>
<%
dim strLocation
dim strRegion
dim NewID
strLocation = Session(“showLocation”)
strRegion = Session(“showRegion”)
Set Connection = Server.CreateObject(“ADODB.Connection”)
Connection.Open “provider=Microsoft.Jet.OLEDB.4.0;data source=
d:inetpub\wwwroot\mdb\img.mdb;”
SQLQueryID= “SELECT DISTINCT ID FROM tblMOETContactList”
Set IDNumbers = Connection.Execute(SQLQueryID)
SQLQueryTitles = “SELECT DISTINCT Title FROM tblMOETContactList WHERE
Region = ‘” &
strRegion & “’ ORDER BY Title”
Set Titles = Connection.Execute(SQLQueryTitles)
NewID = 1
Do Until
IDNumbers.EOF = True
NewID = NewID + 1
IDNumbers.MoveNext
Loop
%>
<p align=center> <b>Add to MOET Contact List </b>
<br><br>
Region: <INPUT value= “<%=strRegion%>” id=showRegion
name=showRegion size=5
style=.border=none
style=.font=bold readonly>
<br><br>
Location: <INPUT value= “<%=strLocation%>” id=showLocation
name=showLocation size=18
style=.border=none
style=.font=bold readonly>
</b></p>
<table align=center>
<tr>
<th>
<th> Title
<th> MOET Contact
<th> email alias
</tr>
<tr>
<td><INPUT
size=1 value=”<%=NewID%>” style=.visibility=hidden id=txtID name=txtID
readonly>
<td><SELECT
name=cboTitles id=cboTitles>
<option
selected value= “”> SELECT
Title
<%
Do Until Titles.EOF =
True
%>
<option>
<%=Titles(“Title”)%> </option>
<%
Titles.MoveNext
Loop
%>
</select>
<td><INPUT
size=30 id=txtName name=txtName>
<td><INPUT
size=15 id=txtAlias name=txtAlias>
</table>
<p align=center><b>
<INPUT id=cmdUpdate name=cmdUpdate type=submit
value= “ Add “>
<INPUT id=cmdCancel name=cmdCancel
type=reset value= “ Reset
“>
</b>
<br><br>
<FONT size=2> <a href= “http://wwopsdev/wwops_img/moet/contactsUpdate.asp”>
START OVER </a>
</font>
</p>
</form>
</body>
</html>
<%@ language=vbscript%>
<html>
<head>
<meta NAME= “GENERATOR” Content= “Microsoft Visual Studio 6.0”>
<link rel= “stylesheet” type= “text/css” href= “css/moet.css”>
<title></title>
</head>
<body>
<form name=contactsInsertContact2.asp method=Post
action=contactsUpdate.asp>
<p align= “center”> <b> <br><br><br>
<%
‘Error trapping
dim ItsAllGood
dim Incomplete
ItsAllGood = “True”
Incomplete = “False
‘Trap if user doesn’t enter complete information
If Request.Form(“cboTitles”) = “” then Incomplete = “True”
If Request.Form(“txtName”) = “” then Incomplete = “True”
If Request.Form(“txtAlias”) =
“” then Incomplete = “True”
If Incomplete = “True” then
Response.Write(“Contact
Title, Name, and Email Alias must all be entered.”)
%>
<br><br>
<%
Response.Write(“Use
your browser’s Back button and complete the form.”)
ItsAllGood = “False”
End if
‘Trap if user enters form illegally
If Request.Form.Count <= 0 then
Response.Write(“You
have entered this form incorrectly.
This page is only accessible from the
contactsUpdateContact.asp page.”)
ItsAllGood = “False”
End if
If ItsAllGood = “True” then
Call WriteRecord
End if
%>
<%
sub WriteRecord
dim strInsertSql
dim commandObject
set Connection =
Server.CreateObject(“ADODB.Connection”)
Connection.open
“provider=Microsoft.Jet.OLEDB.4.0;
data source=
d:inetpub\wwwroot\mdb\img.mdb;”
set commandObject =
Connection
strInsertSql
= “INSERT INTO tblMOETContactList values(“
strInsertSql
= strInsertSql + “’” + Request.Form(“txtID”) + “’,”
strInsertSql
= strInsertSql + “’” + Session(“showRegion”) + “’,”
strInsertSql
= strInsertSql + “’” + Session(“showLocation”) + “’,”
strInsertSql
= strInsertSql + “’” + Request.Form(“cboTitles”) + “’,”
strInsertSql
= strInsertSql + “’” + Request.Form(“txtName”) + “’,”
strInsertSql
= strInsertSql + “’” + Request.Form(“txtAlias”) + “’)”
‘ (to
view SQL string, remove comment mark from the following line)
‘ Response.Write(strInsertSql)
commandObject.Execute(strInsertSql)
Connection.Close
Call
DisplayConfirmation
End sub
%>
<%
sub DisplayConfirmation
Response.Write(“The
new contact has been successfully added to the MOET Contact database. ”)
%>
<br><br>
<INPUT
type= “submit” value= “Update Other MOET Contacts and Locations” id=submit1
name=submit1>
<br><br>
<%
Response.Write(“Press
your browser’s Back button to Add or Modify other Contacts at this Location. ”)
%>
<br></p>
<%
end sub
%>
</p>
</form>
</body>
</html>
<%@ language=vbscript%>
<html>
<head>
<meta NAME= “GENERATOR” Content= “Microsoft Visual Studio 6.0”>
<link rel= “stylesheet” type= “text/css” href= “css/moet.css”>
<title></title>
</head>
<body>
<form name=contactsModifyContact.asp method=Post
action=contactsUpdate.asp>
<p align= “center”> <b> <br><br><br>
<%
‘Error trapping
dim ItsAllGood
dim Incomplete
ItsAllGood = “True”
Incomplete = “False
‘Trap if user doesn’t enter all information
For n = 1 to Request.Form(“txtName”).Count
If
Request.Form(“txtName”)(n) = “” then
If Request.Form(“txtAlias”)(n)
<> “” then
Incomplete
= “True”
End
if
Elseif
Request.Form(“txtName”)(n) <> “” then
If
Request.Form(“txtAlias”)(n) = “” then
Incomplete
= “True”
End
if
End
if
Next
If Request.Form(“newLocation”) = “” then Incomplete = “True”
If Incomplete = “True” then
Response.Write(“Please
enter the new name for this Sales Location.”)
%>
<br><br>
<%
Response.Write(“Use
your browser’s Back button and complete the form.”)
ItsAllGood = “False”
End if
‘Trap if user enters form illegally
If Request.Form.Count <= 0 then
Response.Write(“You
have entered this form incorrectly.
This page is only accessible from the
contactsUpdateContact.asp page.”)
ItsAllGood = “False”
End if
If ItsAllGood = “True” then
Call WriteRecord
End if
%>
<%
sub WriteRecord
dim strInsertSql
dim commandObject
dim n
set Connection = Server.CreateObject(“ADODB.Connection”)
Connection.open
“provider=Microsoft.Jet.OLEDB.4.0;
data source=
d:inetpub\wwwroot\mdb\img.mdb;”
set commandObject =
Connection
for n = 1 to
Request.Form(“txtID”).Count
strInsertSql
= “UPDATE tblMOETContactList SET “
strInsertSql
= strInsertSql +
“tblMOETContactList.Region=
“ + “’” + Session(“showRegion”) + “’,”
strInsertSql
= strInsertSql +
“tblMOETContactList.SalesLocation=
“ + “’” + Session(“showLocation”) + “’,”
strInsertSql
= strInsertSql +
“tblMOETContactList.Title=
“ + “’” + Request.Form(“txtTitle”)(n) + “’,”
strInsertSql
= strInsertSql +
“tblMOETContactList.Contact=
“ + “’” + Request.Form(“txtName”)(n) + “’,”
strInsertSql
= strInsertSql +
“tblMOETContactList.Alias=
“ + “’” + Request.Form(“txtAlias”)(n) + “’”
strInsertSql
= strInsertSql + “ WHERE
“tblMOETContactList.ID=
“ + “’” + Request.Form(“txtID”)(n)
‘ (to
view SQL string, remove comment mark from the following line)
‘ Response.Write(strInsertSql)
commandObject.Execute(strInsertSql)
next
Connection.Close
Call
DisplayConfirmation
End sub
%>
<%
sub DisplayConfirmation
Response.Write(“The
MOET Contact database has been successfully updated. ”)
%>
<br><br>
<INPUT
type= “submit” value= “Update Other MOET Contacts and Locations” id=submit1
name=submit1>
<br><br>
<%
Response.Write(“Press
your browser’s Back button to Add or Modify other Contacts at this Sales
Location.”)
%>
<br></p>
<%
end sub
%>
</p>
</form>
</body>
</html>