Timeout <% Server.ScriptTimeout = 200 Response.Write "This page can run for " Response.Write Server.ScriptTimeout Response.Write " seconds before it times out." %> CreateObject <% Option Explicit Dim conn Dim RSEmp set conn = server.createobject ("adodb.connection") conn.open "ASPBook", "sa", "yourpassword" conn.execute "delete from Emps where EmpID = " & Request.Form("EmpID") set RSEmp = conn.Execute("select * from Emps where EmpID = " _ & Request.Form("NewEmpID")) Response.Write "
" & RSEmp("FirstName") Response.Write "
" & RSEmp("LastName") set conn = Nothing set RSEmp = Nothing %> URLEncode <% Response.Write "Question 1:" & "
" Response.Write "P = 5, B = 8. Using the operators <, >, and = indicate " _ & "the relationship between P and B." & "
" Response.Write "A. P" Response.Write "B. P>B" & "
" Response.Write "C. P=B" & "
" %> <% Response.Write "Question 1:" & "
" Response.Write "P = 5, B = 8. Using the operators <, >, and = indicate " _ & "the relationship between P and B." & "
" Response.Write Server.HTMLEncode("A. P" Response.Write Server.HTMLEncode("B. P>B") & "
" Response.Write Server.HTMLEncode("C. P=B") & "
"
%>
MapPath
<%
Response.Write "Path to parent directory: " & "
"
Response.Write Server.MapPath("../") & "
" & "
"
Response.Write "Path to current directory: " & "
"
Response.Write Server.MapPath ("./") & "
" & "
"
Response.Write "Path to file in current directory: " & "
"
Response.Write Server.MapPath ("myfile.txt") & "
" & "
"
Response.Write "Path to root directory: " & "
"
Response.Write Server.MapPath ("/") & "
" & "
" %> Balance Overdue <% Option Explicit Dim MyWord Dim Path2File Dim Path2File1 if not isempty(Request.Form("Submit")) then set MyWord = Server.Createobject("Word.Application") MyWord.Application.Documents.Open Server.MapPath("../") _ & "\balancedue.doc" MyWord.ActiveWindow.Selection.GoTo -1,,, "CurrentDate" MyWord.ActiveWindow.Selection.TypeText cstr(Date) MyWord.ActiveWindow.Selection.GoTo -1,,, "CustomersName" MyWord.ActiveWindow.Selection.TypeText cstr(Request.Form("CustomersName")) MyWord.ActiveWindow.Selection.GoTo -1,,, "CustomersAddress" MyWord.ActiveWindow.Selection.TypeText cstr(Request.Form("CustomersAddress")) MyWord.ActiveWindow.Selection.GoTo -1,,, "CustomersCSZ" MyWord.ActiveWindow.Selection.TypeText cstr(Request.Form("CustomersCSZ")) MyWord.ActiveWindow.Selection.GoTo -1,,, "FirstName" if instr(Request.Form("CustomersName"), " ") > 0 then MyWord.ActiveWindow.Selection.TypeText _ cstr(left(Request.Form("CustomersName"),instr(Request.Form("CustomersName"), " ")-1)) else MyWord.ActiveWindow.Selection.TypeText cstr(Request.Form("CustomersName")) end if MyWord.ActiveWindow.Selection.GoTo -1,,, "CurrentBalance" MyWord.ActiveWindow.Selection.TypeText cstr(Request.Form("CurrentBalance")) MyWord.ActiveWindow.Selection.GoTo -1,,, "YourName" MyWord.ActiveWindow.Selection.TypeText cstr(Request.Form("YourName")) Path2File1 = Month(Date) & Day(Date) & Year(Date) _ & Hour(Time) & Minute(Time) & Second(Time) & ".doc" Path2File = Server.MapPath("./") & "\" & Path2File1 MyWord.ActiveDocument.SaveAs Path2File set MyWord = Nothing Response.Redirect "./" & Path2File1 end if %> Overdue Account <% Option Explicit Dim MyWord Dim Path2File Dim Path2File1 if not isempty(Request.Form("Submit")) then set MyWord = Server.CreateObject("Word.Application") MyWord.Application.Documents.Open Server.MapPath("../") _ & "\overdue.doc" MyWord.ActiveWindow.Selection.GoTo -1,,, "CurrentDate" MyWord.ActiveWindow.Selection.TypeText cstr(Date) MyWord.ActiveWindow.Selection.GoTo -1,,, "CustomersName" MyWord.ActiveWindow.Selection.TypeText cstr(Request.Form("CustomersName")) MyWord.ActiveWindow.Selection.GoTo -1,,, "CustomersAddress" MyWord.ActiveWindow.Selection.TypeText cstr(Request.Form("CustomersAddress")) MyWord.ActiveWindow.Selection.GoTo -1,,, "CustomersCSZ" MyWord.ActiveWindow.Selection.TypeText cstr(Request.Form("CustomersCSZ")) MyWord.ActiveWindow.Selection.GoTo -1,,, "FirstName" if instr(Request.Form("CustomersName"), " ") > 0 then MyWord.ActiveWindow.Selection.TypeText _ cstr(left(Request.Form("CustomersName"),instr(Request.Form("CustomersName"), " ")-1)) else MyWord.ActiveWindow.Selection.TypeText cstr(Request.Form("CustomersName")) end if MyWord.ActiveWindow.Selection.GoTo -1,,, "DaysOverDue" MyWord.ActiveWindow.Selection.TypeText cstr(Request.Form("DaysOverDue")) MyWord.ActiveWindow.Selection.GoTo -1,,, "DueDate" MyWord.ActiveWindow.Selection.TypeText cstr(Request.Form("DueDate")) MyWord.ActiveWindow.Selection.GoTo -1,,, "YourName" MyWord.ActiveWindow.Selection.TypeText cstr(Request.Form("YourName")) Path2File1 = Month(Date) & Day(Date) & Year(Date) _ & Hour(Time) & Minute(Time) & Second(Time) & ".doc" Path2File = Server.MapPath("./") & "\" & Path2File1 MyWord.ActiveDocument.SaveAs Path2File set MyWord = Nothing Response.Redirect "./" & Path2File1 end if %>