Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Objectives
What You Will Learn
After completing this lab, you will be able to: Create basic script examples, demonstrating how to associate code with events or run inline. Create a script that combines client side and server side scripting.
pport Training
Microsoft Confidential
November 2013
Appendices
pport Training
Microsoft Confidential
November 2013
Appendices
iTar"etYear#Year+Date+,, Tar"etDate#DateSerial+iTar"etYear*-.*/-, iDateDiff#DateDiff+$ $*Date+,* Tar"etDate, Ms"bo0 $To a!1s ate is $ 2 Date+, a!s to !ear en .$ Ms"bo0 iDateDiff 2 $ more 3n &&> <4Script> <4Bo !> <4HTML> Save the file as C:,!'$T)-.,///0((T,C&!$'T*$ (.1T . &aunch icrosoft !nternet $xplorer and test the sample by browsing 1TT):22&ocal1ost2C&!$'T*$ (.1T . Allow the program to complete, dismissing the message box by clic3ing the button mar3ed 4(56. !n !$, view the 1T & source of the client program by selecting the Source menu item from the 7iew menu. /hat information is available in the Source8 !s the script code visible8 /ith what event is the script associated 9hint: loo3 at the name of the sub procedure:. Sub
pport Training
Microsoft Confidential
November 2013
Appendices
;.
To create the server side script example: &aunch '(T$)A*.$+$ and insert the following code example into a new document.
<HTML> <BODY> This is a ser5er 6S7 Demo. It calculates the number of <B8> <B8> <9 Dim iTar"etYear* Tar"etDate* iDateDiff a!s until the en of the !ear.
iTar"etYear#Year+Date+,, Tar"etDate#DateSerial+iTar"etYear*-.*/-, iDateDiff#DateDiff+$ $*Date+,* Tar"etDate, 8esponse.'rite $To a!1s ate is $ 2 Date+, 2 $.<B8>$ a!s to !ear en .$ 8esponse.'rite iDateDiff 2 $ more 9> <4BODY> <4HTML> Save the file as C:,!'$T)-.,///0((T,S$07$0*$ (.AS). &aunch icrosoft !nternet $xplorer and test the sample by browsing http:22localhost2S$07$0*$ (.AS). Allow the program to complete, dismissing the message box by clic3ing the button mar3ed 4(56. !n !$, view the 1T & source of the client program by selecting the Source menu item from the 7iew menu. /hat information is available in the Source8 !s the script code visible8 /ill the script run if the extension of the file is changed to 1T 8
pport Training
Microsoft Confidential
November 2013
Appendices
<.
To combine server side and client side scripting: &aunch '(T$)A*.$+$ and insert the following code example into a new document.
<HTML> <BODY> This is a simple client4ser5er Demo that calculates the number of until the en of the !ear. <B8> <B8> <9 Dim iTar"etYear* Tar"etDate* iDateDiff a!s
iTar"etYear#Year+Date+,, Tar"etDate#DateSerial+iTar"etYear*-.*/-, iDateDiff#DateDiff+$ $*Date+,* Tar"etDate, 9> <Script Lan"ua"e#$VBScript$> <%&& Sub 'in o()OnLoa Ms"Bo0 $To a!1s 3n &&> <4Script> <4BODY> <4HTML> Sub ate is <9#Date+,9>.$ a!s 1til !ear en .$ Ms"Bo0 $<9#iDateDiff9> more
pport Training
Microsoft Confidential
November 2013
Appendices
Save the file as C:,!'$T)-.,///0((T,1=.0!*.AS). &aunch icrosoft !nternet $xplorer and test the sample by browsing http:22localhost21=.0!*.AS). Allow the program to complete, dismissing the message box by clic3ing the button mar3ed 4(56. !n !$, view the 1T & source of the client program by selecting the Source menu item from the 7iew menu. /hat information is available in the Source8 !s the client side script visible8 !s the server side 9the formulas: visible8
Objectives
What You Will Learn
After completing this lab, you will be able to: Configure common application settings using the sheets. icrosoft anagement Console and !!S ".# property
Reco!!ended Reading
pport Training
Microsoft Confidential
November 2013
Appendices
pport Training
Microsoft Confidential
November 2013
Appendices
Clic3 on the button labeled 4Close6 to dismiss the Tip of the *ay dialog. To create a new virtual directory: !n CCs scope pane 9the left most window pane:, navigate to *efault /eb Site as shown below.
@rom the Action menu, select 'ew and choose 7irtual *irectory from the submenu. This should launch the 'ew 7irtual *irectory /iDard.
pport Training
Microsoft Confidential
November 2013
Appendices
Step through the wiDard using the 'ext button, providing the following information as shown in each of the following screen shots: $nter the alias used to access this virtual directory:
pport Training
Microsoft Confidential
November 2013
Appendices
Clic3 the @inish button to complete the creation of the new 7irtual directory. !nternet Service anager should automatically mar3 the new 7irtual *irectory as an application. To test the new virtual directory, launch 1TT):22&ocal1ost2&abs2*efault.AS). icrosoft !nternet $xplorer and browse
pport Training
Microsoft Confidential
November 2013
Appendices
'ote: The password will actually show up as a series of asteris3s9?: for security purposes. Clic3 the button labeled 4Add6. Clic3 the button labeled 4Close6. @rom the -ser menu, select the $xit menu item.
pport Training
Microsoft Confidential
November 2013
Appendices
To secure the web site: &aunch !nternet Service anager. !n the scope pane, select the *efault /eb site for the local machine. @rom the Action menu, select )roperties. Switch to the *irectory Security tab in the *efault /eb Site )roperties dialog.
Clic3 the edit button located in the Anonymous Access and Authentication Control section. This will display the Authentication ethods dialog.
pport Training
Microsoft Confidential
November 2013
Appendices
Clear and set the options for the authentication methods as shown in the image below. $nsure that only .asic Authentication is enabled. 'ote: /hen enabling the .asic Authentication option you will receive a message from !nternet Service anager in a dialog. 0ead the warning, then dismiss this dialog box by clic3ing the button labeled G(5G.
ethods dialog.
Clic3 the button labeled 4(56 to dismiss the /eb Site property sheet. !f you receive an G!nheritance (verrideG dialog as3ing which child nodes should inherit the authentication method, clic3 the button labeled G(5G. Test the authentication method by browsing 1TT):22&ocal1ost from within $xplorer. 9!f necessary, launch !nternet $xplorer.: icrosoft !nternet
/hen prompted for authentication the first time, clic3 the button mar3ed 4Cancel6 to bypass the login to the web page. /hat is the browserCs response8 0efresh the web page using the toolbutton mar3ed 40efresh6. /hen prompted for authentication, type 4.asic-ser6 as the -ser 'ame and 4password6 as the )assword. *o not type the quotes for either -ser 'ame or )assword. Clic3 the button mar3ed 4(56 to accept the user name and password. !s access granted to the web site8
pport Training
Microsoft Confidential
November 2013
Appendices
To restore access to the web site: Switch to !nternet Service anager. !n the scope pane, select the *efault /eb site for the local machine. @rom the Action menu, select )roperties. Switch to the *irectory Security tab in the *efault /eb Site )roperties dialog. Clic3 the edit button located in the Anonymous Access and Authentication Control section. This will display the Authentication ethods dialog. $nable the 4Allow Anonymous Access6 option and disable the .asic Authentication option. /hen 4Allow Anonymous Access6 is enabled, clic3 the topmost button labeled 4$dit6, that lies next to the text 4Account used for Anonymous Access:6 /hat 'T -ser Account is !!S using for anonymous access8 Clic3 the button labeled 4(56 to dismiss the Anonymous -ser Account dialog. Clic3 the button labeled 4(56 to dismiss the Authentication ethods dialog. Clic3 the button labeled 4(56 to dismiss the *efault /eb Site )roperties dialog. !f you receive an G!nheritance (verrideG dialog as3ing which child nodes should inherit the authentication method, clic3 the button labeled G(5G. Switch to icrosoft !nternet $xplorer. .rowse the -0& http:22localhost 9!f itCs still the current page in the browser, simply clic3 on the toolbutton mar3ed 40efresh6.: Are you prompted for a user name and password8
Objectives
What You Will Learn
After completing this lab, you will be able to: Create simple applications using icrosoft 7isual !nterdev. *ebug AS) scripts using the icrosoft Script *ebugger.
Reco!!ended Reading
pport Training
Microsoft Confidential
November 2013
Appendices
pport Training
Microsoft Confidential
November 2013
Appendices
@ile 'ew dialog box: Switch to the )roHects tab and select 4/eb )roHect /iDard. Type the name /ebApp into the )roHect name text box. Clic3 the button labeled 4(56.
pport Training
Microsoft Confidential
November 2013
Appendices
Step % of ; dialog box: !n the Server 'ame text box, type 4&ocalhost6.
pport Training
Microsoft Confidential
November 2013
Appendices
pport Training
Microsoft Confidential
November 2013
Appendices
To add a data connection: @rom the )roHect menu, select 4Add to )roHect6, then select 4*ata Connection6.
SelectSwitch to the achine *ata Source tab. Select the data source 4Adv/or3s6 and clic3 on the button labeled 4(56.
pport Training
Microsoft Confidential
November 2013
Appendices
To create the data forms: @rom the @ile menu, select 4'ewF6.
@ile 'ew dialog box: Switch to the @ile /iDards tab. Type 4Euest.oo36 in the @ile name text box. Clic3 the button labeled 4(56.
pport Training
Microsoft Confidential
November 2013
Appendices
Step % of I dialog box: Select *ataConn from the dropdown as the database connection to use. Type 4Euest .oo3 Application6 in the text box provided for the title that appears at the top of the form.
pport Training
Microsoft Confidential
November 2013
Appendices
Step ; of I dialog box: Choose Table from the listbox provided as the obHect to use for your form.
pport Training
Microsoft Confidential
November 2013
Appendices
Step < of I dialog box: Choose Customers from the Table27iew dropdown. Clic3 the button labeled 4JJ6 to move all fields from the Available @ields listbox over to the Select @ields listbox.
pport Training
Microsoft Confidential
November 2013
Appendices
Step " of I dialog box: $xamine the options available within this dialog. Accept the defaults in the dialog.
/hat functionality does step " of the wiDard provide8 Clic3 on the button labeled 4'ext6.
pport Training
Microsoft Confidential
November 2013
Appendices
pport Training
Microsoft Confidential
November 2013
Appendices
pport Training
Microsoft Confidential
November 2013
Appendices
Step I of I dialog box: 1eave a sigh of relief, since there are no more dialogs.
Clic3 on the button labeled 4@inish6. 1ow many AS) files have been created8 Test the application by browsing the -0& 1TT):22&ocal1ost2/ebApp2Euest.oo3@orm.AS). Create a new record by clic3ing the button mar3ed G'ewG, filling in the fields, then clic3ing on the button mar3ed G!nsertG to add the record. $xperiment and see what the other buttons in the forms do.
pport Training
Microsoft Confidential
November 2013
Appendices
$nable serverLside script debugging by placing a chec3 in the chec3box next to the label G$nable AS) serverLside script debuggingG. Clic3 on the button labeled G(5G to dismiss the Application Configuration dialog. Clic3 on the button labeled G(5G to dismiss the )roperty Sheets dialog.
pport Training
Microsoft Confidential
November 2013
Appendices
To debug errors: Switch bac3 to icrosoft !nternet $xplorer and browse the page 1TT):22&ocal1ost2&abs2&ab<2.ro3en.AS). /hat happens this time8 /hich line is the cursor on in the script debugger8 Switch bac3 to icrosoft !nternet $xplorer. 'ote that the browser should be displaying the cursor as an hourglass. Switch bac3 to icrosoft Script *ebugger. @rom the *ebug menu, select GStop *ebuggingG. 1as the cursor changed in icrosoft !nternet $xplorer8 Close the copy of .ro3en.AS) that is open in open. icrosoft Script *ebugger, leaving Script *ebugger
&aunch '(T$)A*.$+$ and open the file C:,&abs,&ab<,.ro3en.AS). Correct the spelling of the variable i1our in line nine. Save the changes to the file. Switch bac3 to icrosoft !nternet $xplorer and update the script page by clic3ing on the toolbutton labeled G0efreshG. *oes the script wor38 *oes it display a message appropriate for the time of day shown by the computerMs system cloc38 Switch bac3 to icrosoft Script *ebugger. icrosoft Active Server )ages until you locate bro3en.asp @rom the 7iew menu, select G0unning *ocumentsG. $xpand the section listed as
*ouble clic3 on bro3en.asp in the 0unning *ocuments window. This should open a readLonly copy of the newest version of bro3en.asp.
pport Training
Microsoft Confidential
November 2013
Appendices
&ocate the line that reads: i1ourN1our9Time9:: )lace the cursor at the beginning of this line. @rom the *ebug enu, select GToggle .rea3pointG. This should cause the line to change appearance as shown below, which indicates there is a brea3point on the line.
Switch to icrosoft !nternet $xplorer and browse the page 1TT):22&ocal1ost2&abs2&ab<2.ro3en.AS). At this point, icrosoft Script *ebugger should appear, with execution of .ro3en.AS) paused at the brea3point and a yellow arrow appears on the left side of our readLonly file. At which line does the yellow arrow point8 @rom the *ebug menu, select GStep !ntoG. *id the yellow arrow move to a different line8 0epeat the previous step repeatedly until the yellow arrow points to the line containing the $nd !f statement. /hich path did the script run, GEood orningG or GEood AfternoonG8 !s this correct for the current time of day8
pport Training
Microsoft Confidential
November 2013
Appendices
Chec3 the value of i1our: @rom the 7iew menu, select GCommand /indowG. !nside the Command /indow, type 8 i1our )ress $nter.
!t appears that .ro3en.AS) is printing the wrong message for the current time of day. Can you fix .ro3en.AS) to correct this8
Objectives
What You Will Learn
After completing this lab, you will be able to: Access information supplied by the user through forms. -se coo3ies to trac3 user information. -se the E&(.A&.ASA file to run special subroutines upon starting and quitting sessions. -se the 0esponse obHect to send information bac3 to the userCs browser. Add transaction processing using the OPQT0A'SACT!('N60$R-!0$*6PJ directive.
pport Training
Microsoft Confidential
November 2013
Appendices
Reco!!ended Reading
/indows 'T ".# (ption )ac3 *ocumentation.
pport Training
Microsoft Confidential
November 2013
Appendices
pport Training
Microsoft Confidential
November 2013
Appendices
pport Training
Microsoft Confidential
November 2013
Appendices
<HTML> <BODY> <Table bor er#.> <T8><TH>:ame<4TH><TH>Value<4TH> <91Loop throu"h all 5alues an print in table ;or each ob<s5ar in 8e=uest.Ser5erVariables 8esponse.'rite $<T8><TD>$ 8esponse.'rite ob<s5ar 8esponse.'rite $<4TD><TD>$ 8esponse.'rite 8e=uest.Ser5erVariables+ob<s5ar, 8esponse.'rite $<4TD><4T8>$ :e0t9> <4T6BL3> <91>hec? for 3n"lish @S or AB to see (hich fla" to sho( Lan"ua"e#8e=uest.Ser5erVariables+$HTT7)6>>37T)L6:A@6A3$, If Lan"ua"e#$en&us$ then s;la"AI;#$@S6.AI;$ 3lseIf Lan"ua"e#$en&"b$ Then s;la"Aif#$@B.AI;$ 3lse s;la"AI;#$$ 3n If9> 'elcome%<B8> <IMA S8>#$..4Ima"es4<9#s;la"Aif9>$> <4BODY> <4HTML> /hat are the two methods this code uses to send information bac3 to the browser8 Save the file as C:,&abs,&ab",Server7ariables.AS). Test the script by browsing 1TT):22&ocal1ost2&abs2&ab"2Server7ariables.AS). /hich flag is displayed at the bottom of the page8
pport Training
Microsoft Confidential
November 2013
Appendices
!n icrosoft !nternet $xplorer, change the browserCs default language from -S $nglish to .ritish $nglish: . To change $xplorerCs default language: Select 4!nternet (ptions6 from the 7iew menu in !nternet $xplorer. Clic3 on the button labeled 4&anguages6 found on the Eeneral tab.
0emove any languages listed in the language listbox by highlighting the language and clic3ing the button labeled 40emove6. Clic3 the button labeled 4Add6. Select the line that reads 4$nglish 9.ritish: TenLgbU and clic3 on the button labeled 4(56. Clic3 the button labeled 4(56 to dismiss the language dialog box. Clic3 the button labeled 4(56 to dismiss the !nternet (ptions dialog box. 0efresh the current page by clic3ing on the toolbutton labeled 40efresh6. /hat flag is now displayed at the bottom of the page8
pport Training
Microsoft Confidential
November 2013
Appendices
To redirect users to a specific page dependent upon a server variable: &aunch '(T$)A*.$+$ or icrosoft 7isual !nterdev and insert the following script into a new file:
<98esponse.Buffer#True9> <HTML> <BODY> >hec?in" lan"ua"e... <9 Lan"ua"e#8e=uest.Ser5erVariables+$HTT7)6>>37T)L6:A@6A3$, If Lan"ua"e#$en&us$ Then :e(Site#$@S3n"lish.HTM$ 3lseIf Lan"ua"e#$en&"b$ Then :e(Site#$@B3n"lish.HTM$ 3lse :e(Site#$@nBno(n.HTM$ 3n If
8esponse.8e irect :e(Site 9> <4BODY> <4HTML> Save the file as C:,&abs,&ab",&anguageStart.AS). Test the script by browsing 1TT):22&ocal1ost2&abs2&ab"2&anguageStart.AS). /hat is the -0& displayed in the address bar of icrosoft !nternet $xplorer8 0estore $xplorerCs default language to $nglish 9-nited States:TenLusU. .rowse 1TT):22&ocal1ost2&abs2&ab"2&anguageStart.AS). *o you wind up on the same page as you did the previous time8
pport Training
Microsoft Confidential
November 2013
Appendices
<HTML> <BODY> <9 s8esponse-#8e=uest+$te0t-$, 2 $<B8>$ s8esponse.#Ser5er.HTML3nco e+8e=uest+$te0t.$,, 2 $<B8>$ 8esponse.'rite $te0t-#$ 2 s8esponse8esponse.'rite $te0t.#$ 2 s8esponse. 9> <4BODY> <4HTML> Save the new file as )rocess)ost.asp in the C:,&abs,&ab" folder. Test the application by browsing the following -0& in 1TT):22&ocal1ost2&abs2&ab"2-sing)ost.1T . icrosoft !nternet $xplorer:
!n both Text% and Text; text boxes, type 4O.J1$&&(O2.J6 9without the quotes:. Clic3 the button labeled 4(56. *id the new page display the contents of the two text boxes8 1ow do the two values differ8 1ow does the script in )rocess)ost.asp handle the two inputs differently that accounts for the difference8
pport Training
Microsoft Confidential
November 2013
Appendices
So if the name of the script file is Test.asp, then the form tag will be O@(0 $T1(*N6)(ST6J.
ACT!('N6T$ST.AS)6
pport Training
Microsoft Confidential
November 2013
Appendices
<HTML> <BODY> <9 s8esponse-#8e=uest.Cuer!strin"+$te0t-$, s8esponse.#Ser5er.HTML3nco e+8e=uest.Cuer!Strin"+$te0t.D,, 8esponse.'rite $te0t-#$ 2 s8esponse- 2 $<B8>$ 8esponse.'rite $te0t.#$ 2 s8esponse. 2 $<B8>$ 9> <4BODY> <4HTML> Save the new file as )rocessEet.asp in the C:,&abs,&ab" folder. Test the application by browsing the following -0& in 1TT):22&ocal1ost2&abs2&ab"2-singEet.1T . icrosoft !nternet $xplorer:
!n both Text% and Text; text boxes, type 4O.J1$&&(O2.J6 9without the quotes:. Clic3 the button labeled 4(56. *id the new page display the contents of the two text boxes8 /hat appears with the -0& in the address bar of icrosoft !nternet $xplorer8
pport Training
Microsoft Confidential
November 2013
Appendices
<HTML> <BODY> <9 6pplication+$:ame$,#8e=uest.Ser5erVariables+$83MOT3)6DD8$, Session+$:ame$,#8e=uest.Ser5erVariables+$83MOT3)6DD8$, 9> 7a"e One<B8> 6pplication#<9#6pplication+$:ame$,9><B8> Session#<9#Session+$:ame$,9><B8> <6 H83;#$7a"eT(o.6S7$>Ao To :e0t 7a"e<46> <4BODY> <4HTML> Save the file as C:,&abs,&ab",)age(ne.AS). Create another new text file and insert the following script:
<HTML> <BODY> 7a"e T(o<B8> 6pplication#<9#6pplication+$:ame$,9><B8> Session#<9#Session+$:ame$,9><B8> <9Session.6ban on 8esponse.'rite $Session ob<ect close Session#<9#Session+$:ame$,9><B8> <6 H83;#$7a"eThree.6S7$>Ao To :e0t 7a"e<46> <4BODY> <4HTML> Save the file as C:,&abs,&ab",)ageTwo.AS). +Session.6ban on,$9>
pport Training
Microsoft Confidential
November 2013
Appendices
<HTML> <BODY> 7a"e Three<B8> 6pplication#<9#6pplication+$:ame$,9><B8> Session#<9#Session+$:ame$,9><B8> <4BODY> <4HTML> Save the file as C:,&abs,&ab",)ageThree.AS). &aunch icrosoft !nternet $xplorer and test the application by browsing 1TT):22&ocal1ost2&abs2&ab"2)age(ne.AS). /hat are the values of Application and Session8 @ollow the lin3 to the next page. *id Application and Session retain their values8 /hat is the purpose of the Session.Abandon method8 @ollow the lin3 to the next page. *id Application and Session retain their values8 /hat caused Session to lose its value8 1ave your neighbor browse your )age(ne script 91TT):22machinename2&abs2&ab"2)age(ne.AS) where machinename is the computer name of your machine:. a3e note of the values in )ageThree.AS) on your machine. 0efresh the page in your browser using the toolbutton mar3ed 40efresh6. /hat happened to the values when you refreshed your page8 /hy did the Application value change8
pport Training
Microsoft Confidential
November 2013
Appendices
E8etrie5e pre5ious 5alue of >oo?ie LastVisite #8e=uest.>oo?ies+$LastVisit$, E>hec? if If 3lse 8esponse.'rite $'elcome Bac?%<B8>$ 8esponse.'rite 3n If $You last 5isite on $ 2 LastVisite LastVisite #3mpt! then 8esponse.'rite $'elcome. This is !our first 5isit$
8esponse.>oo?ies+$LastVisit$,#:o(+, 8esponse.>oo?ies+$LastVisit$,.30pires#$December /-* .FFF$ 1The ne0t line forces the session to =uit 1pro5in" that no session 5ariable is in5ol5e Session.6ban on 9> <4BODY> <4HTML>
pport Training
Microsoft Confidential
November 2013
Appendices
Save the file as C:,!'$T)-.,///0((T,C((5!$S.AS). &aunch icrosoft !nternet $xplorer and test the script by browsing 1TT):22&ocal1ost2C((5!$S.AS). /hat is displayed in the browser8 Shut down !nternet $xplorer, then repeat the previous step. *id you receive a new message in the browser8
pport Training
Microsoft Confidential
November 2013
Appendices
pport Training
Microsoft Confidential
November 2013
Appendices
Sub OnTransaction>ommit+, 8esponse.'rite $<B8><B>Transaction committe <4B>$ 3n 9> Save the changes to Transaction.asp. .rowse the page 1TT):22&ocal1ost2&abs2&ab"2Transaction.asp. !s the output any different8 (pen Transaction.asp in either 'otepad or 7isual !nterdev. Add the following 7.Script as the first line. Lan"ua"e#DVBScriptD9> Save the changes to Transaction.asp. Sub
<9GTransaction#8e=uire
pport Training
Microsoft Confidential
November 2013
Appendices
Objectives
What You Will Learn
After completing this lab, you will be able to: Send email from a web page using Collaboration *ata (bHects. Create a script that accesses external data using A*(. aintain consistent data by using stored procedures and transactions within A*(. -se the .rowser Capabilities component to identify clientLside 9browser: specifics.
Reco!!ended Reading
/indows 'T ".# (ption )ac3 *ocumentation.
pport Training
Microsoft Confidential
November 2013
Appendices
Lab 'etup
This lab assumes you have copied the labs folder as instructed by the instructor and created a virtual directory called &A.S under !!S ".#.
pport Training
Microsoft Confidential
November 2013
Appendices
<98esponse.Buffer#True9> <HTML> <BODY> <9 Set B8'#>reateOb<ect+$MS'>.Bro(serT!pe$, If B8'.Tables#True Then 8esponse.8e irect $'ithTables.HTM$ 3lse 8esponse.8e irect $'ithoutTables.HTM$ 3n 9> <4BODY> <4HTML> Save the file as C:,&abs,&abB,*efault.AS). &oo3 at the script and try to determine which page will appear if you browse 1TT):22&ocal1ost2&abs2&abB2*efault.AS), based on the information you saw in .0(/S$0.AS). 9*o not browse the page until you have made a guess.: Switch bac3 to icrosoft !nternet $xplorer and browse 1TT):22&ocal1ost2&abs2&abB2*efault.AS). /as the browser redirected to the page you predicted8 /hat change to the .0(/SCA).!'! file can you ma3e to change this behavior8 If
pport Training
Microsoft Confidential
November 2013
Appendices
Dim ob<8S Set ob<8S#Ser5er.>reateob<ect+$6DODB.8ecor set$, ob<8S.Open $Select I from 3mplo!ees$*$DS:#6DV'or?sJ$ Do @ntil ob<8S.3O; 8esponse.'rite ob<8S.;iel s+-, 2 $2H/.$ 8esponse.'rite ob<8S.;iel s+$Last:ame$, 2 $<B8>$ ob<8S.Mo5e:e0t Loop ob<8S.>lose Set ob<8S#:othin" Save the changes to S! )&$A*(.AS). Test S! )&$A*(.AS) by launching 1TT):22&ocal1ost2&abs2S! )&$A*(.AS) in !nternet $xplorer.
pport Training
Microsoft Confidential
November 2013
Appendices
pport Training
Microsoft Confidential
November 2013
Appendices
On 3rror 8esume :e0t Set ob<>onn # >reateOb<ect+$a o b.connection$, Set ob<>m # >reateOb<ect+$a o b.comman $,
ob<>onn.Open $DS:#6 5'or?s$ Set ob<>m .6cti5e>onnection # ob<>onn 1Buil SCL strin" to e0ecute
s;irst#$1$ 2 8e=uest+$;:ame$, 2 $1$ sLast#$1$ 2 8e=uest+$L:ame$, 2 $1$ sSelect#$Select $ 2 s;irst 2 $*$ 2 sLast 2 $J$ sIns#$Insert into 3mplo!ees+;irst:ame*Last:ame, $ ob<>m .>omman Te0t # sIns 2 sSelect ob<>m .30ecute 1>hec? for success If ob<>onn.3rrors.>ount#F Then 8esponse.'rite $Successfull! a 3lse 8esponse.'rite $>oul 3n If not a ne( recor $ e recor $
ob<>onn.>lose Set ob<>onn#:othin" Save the changes to A**-S$0.AS) and test by browsing 1TT):22&(CA&1(ST2&abs2&abB2CA)-S$0.1T in icrosoft !nternet $xplorer. Add yourself as a new user and clic3 the A** button. !f you receive a notice the record was added successfully, clic3 the 7!$/ A&& button on the result page to verify that your name has been added to the $mployees table.
pport Training
Microsoft Confidential
November 2013
Appendices
pport Training
Microsoft Confidential
November 2013
Appendices
pport Training
Microsoft Confidential
November 2013
Appendices
The following table lists the version of applications. 1ost icrosoft !nternet $xplorer <.#
icrosoft 7isual .asic Scripting $dition implemented by host 7.Script 7ersion %.# 7.Script 7ersion ;.# 7.Script 7ersion <.#
pport Training
Microsoft Confidential
November 2013
Appendices
icrosoft !nternet !nformation Server <.# icrosoft !nternet $xplorer ".# icrosoft !nternet !nformation Server ".# icrosoft /indows Scripting 1ost %.# icrosoft (utloo3 WX
The following pages contains a listing of features specific to each version of 7.Script, sorted by type and feature name alphabetically. @or a complete listing of 7.Script 3eywords, or detailed information on a specific 3eyword, please refer to the /indows 'T ".# (ption )ac3 )roduct documentation in the following section: /indows 'T ".# (ption )ac3 )roduct *ocumentation icrosoft !nternet !nformation Server 9!!S: ScripterCs 0eference 7.Script &anguage 0eference
pport Training
Microsoft Confidential
November 2013
Appendices
t 1.0 +eatures
+unctions
Abs Asc Atn CBool CByte CCur CDate CDbl Chr CInt Cos CSng CStr Date DateSerial DateValue Day Exp Fix Hex Hour InputBox InStr Int IsArray IsDate
Microsoft Confidential November 2013
pport Training
Appendices
Oct &ight &n! &#rim Secon! Sgn Sin Space S'r StrComp
#an #ime #imeSerial #imeValue #rim (Boun! (Case Var#ype )ee*!ay +ear
,et-ods
Clear
&aise
pport Training
Microsoft Confidential
November 2013
Appendices
!b"ects
Error
.ro%erties
Description Number
Source
pport Training
Microsoft Confidential
November 2013
Appendices
Statements
Call Dim Do,,, oop Empty Erase Exit False For,,,Next Function I",,,#hen,,,Else Nothing
Null On-Error Option-Explicit &an!omi.e &eDim &em Select-Case Set Sub #rue )hile,,,)en!
pport Training
Microsoft Confidential
November 2013
Appendices
$onstants
pport Training
Microsoft Confidential
November 2013
Appendices
+unctions
Array CreateObject DateA!! DateDi"" Date0art Filter FormatCurrency FormatDate#ime FormatNumber Format0ercent 1etObject Instr&e2 3oin
oa!0icture $onthName &eplace &1B &oun! ScriptEngine ScriptEngineBuil!Version ScriptEngine$ajorVersion ScriptEngine$inorVersion Split Str&e2erse #ypeName )ee*!ayName-
pport Training
Microsoft Confidential
November 2013
Appendices
,et-ods
&ea! ine &emo2e &emo2eAll S*ip S*ip ine )rite )riteBlan* ines )rite ine-
!b"ects
Dictionary FileSystemObject
#extStream
pport Training
Microsoft Confidential
November 2013
Appendices
.ro%erties
Statements
Const For-Each,,,Next
0ri2ate 0ublic-
pport Training
Microsoft Confidential
November 2013
Appendices
$ollections
*rives @iles
@olders
$onstants
Microsoft Confidential November 2013
pport Training
Appendices
Special@older
,et-ods
pport Training
Microsoft Confidential
November 2013
Appendices
Add@olders .uild)ath Copy Copy@ile Copy@older Create@older *elete *elete@ile *elete@older *rive$xists @ile$xists @older$xists EetAbsolute)ath'ame Eet.ase'ame
pport Training
Microsoft Confidential
November 2013
Appendices
Eet*rive Eet*rive'ame Eet$xtension'ame Eet@ile Eet@ile'ame Eet@older Eet)arent@older'ame EetSpecial@older EetTemp'ame ove ove@ile ove@older (penAsTextStream
!b"ects
*rive @ile
@older
.ro%erties
Microsoft Confidential November 2013
pport Training
Properties
76
upport Training
+icrosoft Confidential
:ove!ber -$&#
Properties
9$
Attributes AvailableSpace *ateCreated *ate&astAccessed *ate&ast odified *rive *rive&etter *rives *riveType @iles @ileSystem @reeSpace !s0eady !s0oot@older
upport Training
+icrosoft Confidential
:ove!ber -$&#
Properties
9&
'ame )arent@older )ath 0oot@older Serial'umber Share'ame Short'ame Short)ath SiDe Sub@olders TotalSiDe Type 7olume'ame
Microsoft Visual Basic Scripting Edition
Error Handling
upport Training
+icrosoft Confidential
:ove!ber -$&#
Properties
9-
0anguage &eference
$ntrinsic constants
Feature/Keyword +or%at"urrency +or%atDate.i%e +or%at7u%ber +or%at5ercent Month7a%e 1ee4day7a%e 'b/eneralDate 'b0ongDate 'b0ong.i%e 'bShortDate 'b0ongDate
upport Training
+icrosoft Confidential
:ove!ber -$&#
Properties
9#
'b.ristate+alse 'b.ristateMi2ed 'b.ristate.rue 'b.ristate:seDefault Dictionary +ileSyste%Ob8ect .e2tStrea% &ound +ilter $nstr&e' ?oin &eplace Split Str&e'erse ScriptEngine ScriptEngineBuildVersion ScriptEngineMa8orVersion ScriptEngineMinorVersion
upport Training
+icrosoft Confidential
:ove!ber -$&#