professional visual basic 6 business objects
TRANSCRIPT
INSTALL.LOG*** Installation Started 5/20/3 21:51 ***Title: Source Code for Visual Basic 6.0 Business Objects InstallationSource: C:\DOCUME~1\JAMIE\DESKTOP\VBBOOK~1\VISUAL~1.EXEMade Dir: C:\WroxMade Dir: C:\Wrox\VB6 Pro ObjectsFile Copy: C:\Wrox\VB6 Pro Objects\Readme.txtFile Copy: C:\Wrox\VB6 Pro Objects\video.mdbFile Copy: C:\Wrox\VB6 Pro Objects\person.mdbMade Dir: C:\Wrox\VB6 Pro Objects\Chapter 09File Copy: C:\Wrox\VB6 Pro Objects\Chapter 09\VideoStore.xlsMade Dir: C:\Wrox\VB6 Pro Objects\Chapter 13File Copy: C:\Wrox\VB6 Pro Objects\Chapter 13\GetVideos.aspFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 13\GetVideo.aspMade Dir: C:\Wrox\VB6 Pro Objects\Chapter 14File Copy: C:\Wrox\VB6 Pro Objects\Chapter 14\VideoIIS.vbpFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 14\GetVideos.DsrFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 14\searchform.htmFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 14\searchform1.htmFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 14\GetVideos.DCAFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 14\HelloWorld.vbpFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 14\getvideo.aspFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 14\getvideos.htmFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 14\getvideos1.htmFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 14\hello.htmFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 14\listvideos.htmFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 14\displayvideo.htmFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 14\WebClass1.DCAFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 14\WebClass1.DsrMade Dir: C:\Wrox\VB6 Pro Objects\Chapter 15File Copy: C:\Wrox\VB6 Pro Objects\Chapter 15\modDHTML.basFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 15\CustEdit.DsrFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 15\CustEdit.dsxFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 15\CustList.DCAFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 15\CustList.DsrFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 15\CustList.dsxFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 15\CustSearch.DCAFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 15\CustSearch.DsrFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 15\CustSearch.dsxFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 15\CustEdit.DCAFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 15\VideoDHTML.vbpMade Dir: C:\Wrox\VB6 Pro Objects\Chapter 05File Copy: C:\Wrox\VB6 Pro Objects\Chapter 05\Business.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 05\Customer.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 05\VideoObjects.vbpFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 05\CustomerDisplay.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 05\BrokenRules.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 05\Customers.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 05\VideoDisplay.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 05\Videos.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 05\TextList.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 05\Video.clsMade Dir: C:\Wrox\VB6 Pro Objects\Chapter 06File Copy: C:\Wrox\VB6 Pro Objects\Chapter 06\Video.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 06\Customer.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 06\CustomerDisplay.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 06\Customers.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 06\TextList.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 06\Business.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 06\VideoDisplay.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 06\Videos.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 06\VideoObjects.vbpFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 06\Tape.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 06\Tapes.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 06\Invoice.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 06\InvoiceItem.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 06\InvoiceFee.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 06\InvoiceTape.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 06\InvoiceItems.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 06\BrokenRules.clsMade Dir: C:\Wrox\VB6 Pro Objects\Chapter 10Made Dir: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoObjectsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoObjects\Business.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoObjects\Customer.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoObjects\CustomerDisplay.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoObjects\Customers.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoObjects\InvoiceItems.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoObjects\InvoiceFee.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoObjects\InvoiceItem.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoObjects\Invoice.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoObjects\InvoiceTape.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoObjects\Tape.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoObjects\TextList.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoObjects\Tapes.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoObjects\Video.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoObjects\VideoDisplay.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoObjects\Videos.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoObjects\VideoObjects.vbpFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoObjects\VOmain.basFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoObjects\VideoTypes.basFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoObjects\BrokenRules.clsMade Dir: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoServerFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoServer\VOmain.basFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoServer\CustomerPersist.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoServer\VideoServer.vbpFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoServer\TextListPersist.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoServer\Buffer.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoServer\VideosPersist.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoServer\CustomersPersist.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoServer\TapesPersist.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoServer\VideoPersist.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoServer\TapePersist.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoServer\InvoicePersist.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoServer\InvoiceItemsPersist.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoServer\InvoiceFeePersist.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 10\VideoServer\InvoiceTapePersist.clsMade Dir: C:\Wrox\VB6 Pro Objects\Chapter 07File Copy: C:\Wrox\VB6 Pro Objects\Chapter 07\VideoSearch.frmFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 07\CustomerList.frmFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 07\CustomerSearch.frmFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 07\InvoiceEdit.frmFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 07\InvoiceTapeEdit.frmFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 07\TapeEdit.frmFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 07\VideoEdit.frmFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 07\VideoList.frmFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 07\VideoMain.frmFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 07\CustomerEdit.frmFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 07\VUImain.basFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 07\VideoUI.vbpFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 07\BusForm.frmMade Dir: C:\Wrox\VB6 Pro Objects\Chapter 08Made Dir: C:\Wrox\VB6 Pro Objects\Chapter 08\VideoObjectsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 08\VideoObjects\Business.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 08\VideoObjects\Customer.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 08\VideoObjects\CustomerDisplay.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 08\VideoObjects\Customers.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 08\VideoObjects\Invoice.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 08\VideoObjects\InvoiceFee.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 08\VideoObjects\InvoiceItem.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 08\VideoObjects\InvoiceItems.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 08\VideoObjects\InvoiceTape.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 08\VideoObjects\Tape.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 08\VideoObjects\TextList.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 08\VideoObjects\Tapes.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 08\VideoObjects\Video.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 08\VideoObjects\VideoDisplay.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 08\VideoObjects\Videos.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 08\VideoObjects\VideoObjects.vbpFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 08\VideoObjects\VOmain.basFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 08\VideoObjects\BrokenRules.clsMade Dir: C:\Wrox\VB6 Pro Objects\Chapter 04Made Dir: C:\Wrox\VB6 Pro Objects\Chapter 04\PersonFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Person\frmEditPerson.frmFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Person\Person.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Person\BrokenRules.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Person\PersonObjects.vbpFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Person\PersonDemo.vbpFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Person\PersonProjects.vbgMade Dir: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence1File Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence1\BrokenRules.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence1\Person.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence1\frmEditPerson.frmFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence1\PersonProjects.vbgFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence1\PersonDemo.vbpFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence1\PersonObjects.vbpFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence1\PersonUDTs.basFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence1\PersonManager.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence1\PersonServer.vbpFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence1\PersonServer.exeMade Dir: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence2File Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence2\PersonServer.vbpFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence2\BrokenRules.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence2\Person.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence2\PersonManager.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence2\frmEditPerson.frmFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence2\PersonProjects.vbgFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence2\PersonUDTs.basFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence2\PersonDemo.vbpFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence2\PersonObjects.vbpFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence2\PersonServer.exeFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 04\Persistence2\PersonObjects.vbwMade Dir: C:\Wrox\VB6 Pro Objects\Chapter 12File Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoProjectsMTS.vbgFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsASP.dllFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsASP.libFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsASP.expMade Dir: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsMTSFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsMTS\Business.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsMTS\Customer.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsMTS\CustomerDisplay.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsMTS\Customers.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsMTS\InvoiceItems.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsMTS\InvoiceFee.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsMTS\InvoiceItem.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsMTS\Invoice.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsMTS\InvoiceTape.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsMTS\Tape.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsMTS\TextList.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsMTS\Tapes.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsMTS\Video.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsMTS\VideoDisplay.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsMTS\Videos.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsMTS\VideoObjects.vbpFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsMTS\VOmain.basFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsMTS\VideoTypes.basFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsMTS\Buffer.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoObjectsMTS\BrokenRules.clsMade Dir: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoServerMTSFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoServerMTS\VideoPersist.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoServerMTS\CustomerPersist.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoServerMTS\CustomersPersist.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoServerMTS\InvoiceFeePersist.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoServerMTS\InvoiceItemsPersist.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoServerMTS\InvoicePersist.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoServerMTS\InvoiceTapePersist.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoServerMTS\TapePersist.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoServerMTS\TapesPersist.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoServerMTS\TextListPersist.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoServerMTS\Buffer.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoServerMTS\VideoServer.vbpFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoServerMTS\VideosPersist.clsFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoServerMTS\VideoTypes.basFile Copy: C:\Wrox\VB6 Pro Objects\Chapter 12\VideoServerMTS\VOmain.basFile Copy: C:\WINDOWS\UNWISE.EXE
person.mdbSSNNameBirthdate
12345678900cab211/11/76
00987654321cab312/12/76
11111111111abcdef 1/1/56
12345678901cab2 11/11/76
12121212121Dr Doom 11/1/67
Readme.txt***** Visual Basic 6.0 Business Objects *****
This installation will install the source code for Visual Basic 6.0 Business Objects onto your machine.
However, due to the nature of the book the code will not necessarily run straight off but rather will require some additional tinkering so that it will run on your machine(s).
1. The UI interface constructed in Chapter 7 will fail to load properly due to its use of Windows Common Controls 6.0 to provide the ListView control. As such if you load this project you will get several error messages and all instances of the ListView control will be replaced with a PictureBox control. You will have to add the Windows Common Controls 6.0 Component to the project and reinsert the LsitView controls and configure them correctly as described in Chapter 7 of the book.
2. You will note that these files contains only the code and no compiled versions are included. Thus from Chapter 9 onwards you will need to compile this code yourself. This is mainly because you may need to adjust some of the code to run on your machine(s) - see below.
3. For Chapter 4 and from Chapter 8 onwards you may need to adjust the path where the relevant databases can be found. A copy of Video.mdb and Person.mdb are included in this installation and the code uses their location but only if you install the files to C:\Wrox\VB6 Pro Objects For Chapter 12 you will also need to upsize the database into SQL Server yourself for the code to work.
4. From Chapter 10 onwards you will need to change the constant PERSIST_SERVER such that it specifies the name or IP address of the machine upon which you will running the program.
5. For Chapter 12 you will need to setup the dll to be run in MTS yourself as described in the book.
6. The last few chapters using Web applications as a front end will require you to set up the relevant directory structure as specified in the book and copy the source code to that location.
If you have any problems with the code please contact [email protected]
******** ********** **********
video.mdbCategoryIDCategory
1Comedy
2Drama
3Horror
4SF
5Action
6Children
CustomerIDNamePhoneAddress1Address2CityStateZipCode
6Teresa Lhotka 777-00772nd AvN St Paul MN 55555
7Timothy Lhotka 777-00772nd Av N St Paul MN 55555
8Fred Jones 735-3162
9Rockford Lhotka 555-1234 123 Somestreet Sometown MN 00000
10Mary Sue Excel 555-1234 1 Microsoft Way Redmond WA 00001
11Fred Jones 555-1234 12 Nowhere St Address line 2 SomeCity ST12345-0789
14Marjorie Andrews 222-1111 654 88th St Wildermere WI 12345-6789
15T Briggs44121 706 6826
16Jeremy Beacock 275-56755 Birmingham AL04000
17Fox Mulder 555-1088 Appartment 42 GeorgeTown Washington DC12347
18Dana K. Scully 555-1050 21 Lincoln Rd Blackwood Washington DC09876
19Craig Berry 555 3868 11 Collingham Rd Earls Court London UK12390
20Adrian Kaldvelksi 555-9995 100 SkyView Rd Kryptin 00666
InvoiceIDCustomerIDSubtotalTaxTotal
751.990.132.12
833.980.264.24
934.50.294.79
1034.50.294.79
1134.50.294.79
1234.50.294.79
1334.50.294.79
1434.50.294.79
1530.00.00.0
1685.970.396.359999999999999
1751.990.132.12
1883.490.233.72
1951.990.132.12
2081.990.132.12
2155.00.335.33
2253.00.23.2
2353.00.23.2
2453.00.23.2
2551.990.132.12
2651.990.132.12
2751.990.132.12
2851.990.132.12
2951.990.132.12
3051.990.132.12
3151.990.132.12
3271.990.132.12
3371.990.132.12
34151.990.132.12
35171.990.132.12
36173.980.264.24
37170.00.00.0
38171.990.132.12
3981.990.132.12
40171.990.132.12
41171.990.132.12
4281.990.132.12
4361.990.132.12
4481.990.132.12
45171.990.132.12
4681.990.132.12
471710.990.7111.7
48191.990.132.12
49193.980.264.24
50191.990.132.12
51201.990.132.12
52201.990.132.12
InvoiceIDItemIDTapeIDPrice
7311.99
8441.99
8551.99
166121.99
167101.99
16811.99
17911.99
181081.99
191141.99
201211.99
211342.0
211453.0
2515181.99
2516181.99
2517181.99
2518181.99
2519181.99
2520181.99
2521181.99
262211.99
2723241.99
282491.99
2925101.99
2926101.99
2927101.99
2928101.99
3029111.99
3031111.99
3132131.99
323341.99
333411.99
343511.99
3536121.99
3637211.99
3638211.99
383991.99
394081.99
4041391.99
4142381.99
4243371.99
4344401.99
4445411.99
4546411.99
4647411.99
4748411.99
4849431.99
4950431.99
4951431.99
5052441.99
5153481.99
5254481.99
FeeIDCustomerIDTapeIDFeeDateDaysOverPaidPaidDateDeleted
1357/25/973false7/25/97false
28127/25/971true7/25/97false
3518/1/972true8/10/97false
55410/16/9765falsefalse
617419/24/986false9/24/98false
7204810/6/982falsefalse
RatingIDRating
1G
2PG
3PG-13
4R
5NC-17
6NR
TapeIDVideoIDCheckedOutDateAcquiredDateDueInvoiceID
13false1/1/9711/22/970
54true2/2/878/12/9721
64false5/5/880
77false3/1/970
128false4/4/979/20/980
139false7/1/768/13/9731
149false7/1/970
2210false9/11/8812/30/990
2511false1/2/9712/30/990
2715false8/7/890
2816false10/13/970
298false2/2/870
3017false10/20/970
3218false11/11/840
3419false10/10/980
417false4/4/979/26/9847
4320true9/9/9810/4/9849
4420true9/9/9810/4/9850
4621false10/11/880
4822false10/10/9710/4/9852
VideoIDTitleReleaseDateStudioCategoryRating
3The Muppet Movie 1/1/97Jim Henson Productions 61
4Eraser 1/1/88Paramount 54
6High Noon 9/4/54Western Productions 52
7The Money Train 2/15/97Warner Bros 54
8The Princess Bride 3/12/94New Line 13
9Star Wars 7/1/77Fox 42
10The Aftermath 9/8/88MGM 34
16The Full Monty 12/10/97Fox Searchlight 15
17The English Patient 9/20/97Miramax 24
18The Empire Strikes Back 1/7/80Fox 42
19The Last Days of Disco 9/9/98Miramax 23
20The X-Files 8/21/98Fox43
21The Return of the Jedi 1/7/83Fox 41
22Scream 6/6/97Miramax 34
Chapter 15/CustEdit.DCA
Chapter 15/CustEdit.DsrVERSION 5.00Begin {90290CCD-F27D-11D0-8031-00C04FB6C701} CustEdit ClientHeight = 5025 ClientLeft = 0 ClientTop = 0 ClientWidth = 7635 _ExtentX = 13467 _ExtentY = 8864 SourceFile = "" BuildFile = "" BuildMode = 0 TypeLibCookie = 302 AsyncLoad = 0 'False id = "DHTMLPage1" ShowBorder = -1 'True ShowDetail = 0 'False AbsPos = -1 'True HTMLDocument = "CustEdit.dsx":0000EndAttribute VB_Name = "CustEdit"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = TrueAttribute VB_PredeclaredId = FalseAttribute VB_Exposed = TrueOption Explicit
Private WithEvents mobjCustomer As CustomerAttribute mobjCustomer.VB_VarHelpID = -1Private mflgLoading As Boolean
Private Sub mobjCustomer_Valid(IsValid As Boolean) cmdOK.disabled = Not IsValid cmdApply.disabled = Not IsValid
End Sub
Private Sub txtAddr1_onblur() txtAddr1.Value = mobjCustomer.Address1End Sub
Private Sub txtAddr2_onblur() txtAddr2.Value = mobjCustomer.Address2End Sub
Private Sub txtCity_onblur() txtCity.Value = mobjCustomer.CityEnd Sub
Private Sub txtName_onblur() txtName.Value = mobjCustomer.NameEnd Sub
Private Function txtName_onchange() As Boolean
If mflgLoading Then Exit Function On Error Resume Next mobjCustomer.Name = txtName.Value
If Err Then Beep txtName.Value = mobjCustomer.Name End If
End Function
Private Function txtAddr1_onchange() As Boolean
If mflgLoading Then Exit Function On Error Resume Next mobjCustomer.Address1 = txtAddr1.Value
If Err Then Beep txtAddr1.Value = mobjCustomer.Address1 End If
End Function
Private Function txtAddr2_onchange() As Boolean
If mflgLoading Then Exit Function On Error Resume Next mobjCustomer.Address2 = txtAddr2.Value
If Err Then Beep txtAddr2.Value = mobjCustomer.Address2 End If
End Function
Private Function txtCity_onchange() As Boolean
If mflgLoading Then Exit Function On Error Resume Next mobjCustomer.City = txtCity.Value
If Err Then Beep txtCity.Value = mobjCustomer.City End If
End Function
Private Sub txtPhone_onblur() txtPhone.Value = mobjCustomer.PhoneEnd Sub
Private Sub txtState_onblur() txtState.Value = mobjCustomer.StateEnd Sub
Private Function txtState_onchange() As Boolean
If mflgLoading Then Exit Function On Error Resume Next mobjCustomer.State = txtState.Value
If Err Then Beep txtState.Value = mobjCustomer.State End If
End Function
Private Sub txtZipCode_onblur() txtZipCode.Value = mobjCustomer.ZipCodeEnd Sub
Private Function txtZipCode_onchange() As Boolean
If mflgLoading Then Exit Function On Error Resume Next mobjCustomer.ZipCode = txtZipCode.Value
If Err Then Beep txtZipCode.Value = mobjCustomer.ZipCode End If
End Function
Private Function txtPhone_onchange() As Boolean
If mflgLoading Then Exit Function On Error Resume Next mobjCustomer.Phone = txtPhone.Value
If Err Then Beep txtPhone.Value = mobjCustomer.Phone End If
End Function
Private Sub EnableOK(flgValid As Boolean)
cmdOK.disabled = Not flgValid cmdApply.disabled = Not flgValid
End Sub
Private Sub DHTMLPage_Load()
Dim lngID As Long mflgLoading = True lngID = GetProperty(BaseWindow.Document, "CustomerID") Set mobjCustomer = New Customer mobjCustomer.Load lngID
With mobjCustomer EnableOK .IsValid If .IsNew Then BaseWindow.Document.Title = "Customer [(new)]"
Else BaseWindow.Document.Title = "Customer [" & .Name & "]"
End If
txtName.Value = .Name txtAddr1.Value = .Address1 txtAddr2.Value = .Address2 txtCity.Value = .City txtState.Value = .State txtZipCode.Value = .ZipCode txtPhone.Value = .Phone .BeginEdit End With
mflgLoading = False
End Sub
Private Function cmdApply_onclick() As Boolean
mobjCustomer.ApplyEdit mobjCustomer.BeginEdit
End Function
Private Function cmdOK_onclick() As Boolean
mobjCustomer.ApplyEdit BaseWindow.navigate "VideoDHTML_CustSearch.htm"
End Function
Private Function cmdCancel_onclick() As Boolean
mobjCustomer.CancelEdit BaseWindow.navigate "VideoDHTML_CustSearch.htm"
End Function
Chapter 15/CustEdit.dsx[`QO
Name
Address
Phone
Chapter 15/CustList.DCA
Chapter 15/CustList.DsrVERSION 5.00Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"Begin {90290CCD-F27D-11D0-8031-00C04FB6C701} CustList ClientHeight = 6855 ClientLeft = 0 ClientTop = 0 ClientWidth = 10560 _ExtentX = 18627 _ExtentY = 12091 SourceFile = "" BuildFile = "" BuildMode = 0 TypeLibCookie = 228 AsyncLoad = 0 'False id = "CustList" ShowBorder = -1 'True ShowDetail = 0 'False AbsPos = -1 'True HTMLDocument = "CustList.dsx":0000EndAttribute VB_Name = "CustList"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = TrueAttribute VB_PredeclaredId = FalseAttribute VB_Exposed = TrueOption Explicit
Private Function cmdCancel_onclick() As Boolean BaseWindow.navigate "VideoDHTML_CustSearch.html"End Function
Private Function cmdOK_onclick() As Boolean PutProperty BaseWindow.Document, "CustomerID", Val(lvwItems.SelectedItem.Key) BaseWindow.navigate "VideoDHTML_CustEdit.html"
End Function
Private Sub DHTMLPage_Load()
Dim strName As String Dim strPhone As String Dim objCustomers As Customers Dim divCustInfo As Object strName = GetProperty(BaseWindow.Document, "SearchName") strPhone = GetProperty(BaseWindow.Document, "SearchPhone") Set objCustomers = New Customers objCustomers.Load strName, strPhone
ListCustomers objCustomers Set objCustomers = Nothing
End Sub
Private Sub ListCustomers(objCustomers As Customers)
Dim objItem As CustomerDisplay Dim itmList As ListItem Dim lngIndex As Long With lvwItems .View = lvwReport .FullRowSelect = True .LabelEdit = lvwManual .ColumnHeaders(1).Text = "Name" .ColumnHeaders.Add Text:="Phone" End With
For lngIndex = 1 To objCustomers.Count Set objItem = objCustomers.Item(lngIndex) Set itmList = _ lvwItems.ListItems.Add(Key:= _ Format$(objItem.CustomerID) & " K")
With itmList .Text = objItem.Name .SubItems(1) = objItem.Phone End With
Next
End Sub
Chapter 15/CustList.dsxJ[`QO6
Chapter 15/CustSearch.DCA
Chapter 15/CustSearch.DsrVERSION 5.00Begin {90290CCD-F27D-11D0-8031-00C04FB6C701} CustSearch ClientHeight = 4110 ClientLeft = 1815 ClientTop = 1545 ClientWidth = 7215 _ExtentX = 12726 _ExtentY = 7250 SourceFile = "" BuildFile = "" BuildMode = 0 TypeLibCookie = 243 AsyncLoad = 0 'False id = "CustSearch" ShowBorder = -1 'True ShowDetail = -1 'True AbsPos = 0 'False HTMLDocument = "CustSearch.dsx":0000EndAttribute VB_Name = "CustSearch"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = TrueAttribute VB_PredeclaredId = FalseAttribute VB_Exposed = TrueOption Explicit
Private Function cmdSearch_onclick() As Boolean PutProperty BaseWindow.Document, "SearchName", txtName.Value PutProperty BaseWindow.Document, "SearchPhone", txtPhone.Value BaseWindow.navigate "VideoDHTML_CustList.html"
End Function
Chapter 15/CustSearch.dsxe[`QOQNamePhone
Chapter 15/modDHTML.basAttribute VB_Name = "modDHTML"'PutProperty: Store information in a cookie by calling this' function.' The required inputs are the named Property' and the value of the property you would like to store.'' Optional inputs are:' expires : specifies a date that defines the valid life time' of the property. Once the expiration date has been' reached, the property will no longer be stored or given out.
Public Sub PutProperty(objDocument As HTMLDocument, strName As String, vntValue As Variant, Optional Expires As Date)
objDocument.cookie = strName & "=" & CStr(vntValue) & _ IIf(CLng(Expires) = 0, "", "; expires=" & Format(CStr(Expires), "ddd, dd-mmm-yy hh:mm:ss") & " GMT") ' & _
End Sub
'GetProperty: Retrieve the value of a property by calling this' function. The required input is the named Property,' and the return value of the function is the current value' of the property. If the proeprty cannot be found or has expired,' then the return value will be an empty string.'Public Function GetProperty(objDocument As HTMLDocument, strName As String) As Variant Dim aryCookies() As String Dim strCookie As Variant On Local Error GoTo NextCookie
'Split the document cookie object into an array of cookies. aryCookies = Split(objDocument.cookie, ";") For Each strCookie In aryCookies If Trim(VBA.Left(strCookie, InStr(strCookie, "=") - 1)) = Trim(strName) Then GetProperty = Trim(Mid(strCookie, InStr(strCookie, "=") + 1)) Exit Function End IfNextCookie: Err = 0 Next strCookieEnd Function
Chapter 15/VideoDHTML.vbpType=OleDllReference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\WINDOWS\SYSTEM\STDOLE2.TLB#OLE AutomationReference=*\G{90290CCA-F27D-11D0-8031-00C04FB6C701}#1.0#0#..\..\..\PROGRAM FILES\COMMON FILES\DESIGNER\MSHTMPGR.DLL#MSHTMLPG Control Library Reference=*\G{3050F1C5-98B5-11CF-BB82-00AA00BDCE0B}#4.0#0#..\..\..\WINDOWS\SYSTEM\MSHTML.DLL#Microsoft HTML Object LibraryObject={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCXDesigner=CustSearch.DsrModule=modDHTML; modDHTML.basDesigner=CustList.DsrDesigner=CustEdit.DsrStartup="(None)"HelpFile=""Command32=""Name="VideoDHTML"HelpContextID="0"Description="DHTML Application Project"CompatibleMode="1"MajorVer=1MinorVer=0RevisionVer=0AutoIncrementVer=0ServerSupportFiles=0VersionCompanyName="Wrox Press"CompilationType=0OptimizationType=0FavorPentiumPro(tm)=0CodeViewDebugInfo=0NoAliasing=0BoundsCheck=0OverflowCheck=0FlPointCheck=0FDIVCheck=0UnroundedFP=0StartMode=1Unattended=0Retained=0ThreadPerObject=0MaxNumberOfThreads=1ThreadingModel=1DebugStartupOption=1DebugStartupComponent=CustSearch
Chapter 14/displayvideo.htm
Studio Presents Title
This movie is rated 'Rating' RatingText
We have TapeCount available for rental
Chapter 14/getvideo.asp
Chapter 14/GetVideos.DCA
Chapter 14/GetVideos.DsrVERSION 5.00Begin {17016CEE-E118-11D0-94B8-00A0C91110ED} GetVideos ClientHeight = 5445 ClientLeft = 750 ClientTop = 1425 ClientWidth = 7320 _ExtentX = 12912 _ExtentY = 9604 MajorVersion = 0 MinorVersion = 8 StateManagementType= 1 ASPFileName = "" DIID_WebClass = "{12CBA1F6-9056-11D1-8544-00A024A55AB0}" DIID_WebClassEvents= "{12CBA1F5-9056-11D1-8544-00A024A55AB0}" TypeInfoCookie = 15 BeginProperty WebItems {193556CD-4486-11D1-9C70-00C04FB987DF} WebItemCount = 3 BeginProperty WebItem1 {FA6A55FE-458A-11D1-9C71-00C04FB987DF} MajorVersion = 0 MinorVersion = 8 Name = "DisplayVideo" DISPID = 1280 Template = "displayvideo.htm" Token = "WC@" DIID_WebItemEvents= "{0672650A-56C1-11D2-93E5-00104B4C8457}" ParseReplacements= 0 'False AppendedParams = "" HasTempTemplate = 0 'False UsesRelativePath= -1 'True OriginalTemplate= "C:\displayvideo.htm" TagPrefixInfo = 2 BeginProperty Events {193556D1-4486-11D1-9C70-00C04FB987DF} EventCount = 0 EndProperty BeginProperty BoundTags {FA6A55FA-458A-11D1-9C71-00C04FB987DF} AttribCount = 0 EndProperty EndProperty BeginProperty WebItem2 {FA6A55FE-458A-11D1-9C71-00C04FB987DF} MajorVersion = 0 MinorVersion = 8 Name = "ListVideos" DISPID = 1281 Template = "listvideos.htm" Token = "WC@" DIID_WebItemEvents= "{8ECCB7D4-56B9-11D2-93E5-00104B4C8457}" ParseReplacements= 0 'False AppendedParams = "" HasTempTemplate = 0 'False UsesRelativePath= -1 'True OriginalTemplate= "C:\listvideos.htm" TagPrefixInfo = 2 BeginProperty Events {193556D1-4486-11D1-9C70-00C04FB987DF} EventCount = 0 EndProperty BeginProperty BoundTags {FA6A55FA-458A-11D1-9C71-00C04FB987DF} AttribCount = 0 EndProperty EndProperty BeginProperty WebItem3 {FA6A55FE-458A-11D1-9C71-00C04FB987DF} MajorVersion = 0 MinorVersion = 8 Name = "SearchForm" DISPID = 1282 Template = "searchform1.htm" Token = "WC@" DIID_WebItemEvents= "{067264EC-56C1-11D2-93E5-00104B4C8457}" ParseReplacements= 0 'False AppendedParams = "" HasTempTemplate = 0 'False UsesRelativePath= -1 'True OriginalTemplate= "C:\InetPub\wwwroot\wroxvideo\searchform.htm" TagPrefixInfo = 2 BeginProperty Events {193556D1-4486-11D1-9C70-00C04FB987DF} EventCount = 0 EndProperty BeginProperty BoundTags {FA6A55FA-458A-11D1-9C71-00C04FB987DF} AttribCount = 0 EndProperty EndProperty EndProperty NameInURL = "getvideos"EndAttribute VB_Name = "GetVideos"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = TrueAttribute VB_PredeclaredId = FalseAttribute VB_Exposed = TrueOption Explicit
Private objVideos As VideosPrivate objVideo As Video
Private Sub WebClass_Start() With Request.Form If .Count = 0 Then
SearchForm.WriteTemplate Else Set objVideos = New Videos objVideos.Load .Item("txtTitle"), .Item("txtStudio") ListVideos.WriteTemplate End If End WithEnd Sub
Private Sub ListVideos_ProcessTag(ByVal TagName As String, _ TagContents As String, SendTags As Boolean) Dim strResponse As String Dim objItem As VideoDisplay For Each objItem In objVideos strResponse = strResponse & "" strResponse = strResponse & "" & _ objItem.Title & "" strResponse = strResponse & "" & objItem.ReleaseDate strResponse = strResponse & ""
strResponse = strResponse & "" Next Set objVideos = Nothing TagContents = strResponseEnd Sub
Private Sub DisplayVideo_UserEvent(ByVal EventName As String) Set objVideo = New Video objVideo.Load Val(EventName) DisplayVideo.WriteTemplateEnd Sub
Private Sub DisplayVideo_ProcessTag(ByVal TagName As String, _ TagContents As String, SendTags As Boolean) Dim intAvail As Integer
Select Case TagContents Case "Title" TagContents = objVideo.Title Case "Studio" TagContents = objVideo.Studio Case "Rating" TagContents = objVideo.Rating Case "RatingText" Select Case objVideo.Rating Case "G" TagContents = "suitable for general audiences" Case "PG" TagContents = "parental guidance suggested" Case "PG-13" TagContents = "not suitable for children under age 13" Case "R" TagContents = "children under 17 not admitted without parent" Case "NR" TagContents = "not rated - for mature audiences" End Select Case "TapeCount" intAvail = objVideo.Tapes.Count If intAvail = 0 Then TagContents = "no tapes " ElseIf intAvail = 1 Then TagContents = "1 tape " Else TagContents = intAvail & " tapes " End If End SelectEnd Sub
Chapter 14/getvideos.htm
Title:
Studio:
Chapter 14/getvideos1.htm
Title:
Studio:
Chapter 14/hello.htm
Hello world!
Some text
Chapter 14/HelloWorld.vbpType=OleDllReference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\WINDOWS\SYSTEM\STDOLE2.TLB#OLE AutomationReference=*\G{198887E2-AC76-11D0-A77C-00A024A55AB0}#1.0#0#..\..\..\PROGRAM FILES\COMMON FILES\DESIGNER\MSWCRUN.DLL#Microsoft WebClass LibraryDesigner=WebClass1.DsrReference=*\G{D97A6DA0-A85C-11CF-83AE-00A0C90C2BD8}#2.0#0#D:\Microsoft Visual Studio\Common\IDE\IDE98\ASP.TLB#Microsoft Active Server Pages Object LibraryStartup="(None)"HelpFile=""Title="Project1"Command32=""Name="HelloWorld"HelpContextID="0"CompatibleMode="1"MajorVer=1MinorVer=0RevisionVer=0AutoIncrementVer=0ServerSupportFiles=0VersionCompanyName="Wrox Press"CompilationType=0OptimizationType=0FavorPentiumPro(tm)=0CodeViewDebugInfo=0NoAliasing=0BoundsCheck=0OverflowCheck=0FlPointCheck=0FDIVCheck=0UnroundedFP=0StartMode=1Unattended=-1Retained=1ThreadPerObject=0MaxNumberOfThreads=1DebugStartupOption=1DebugStartupComponent=WebClass1
[MS Transaction Server]AutoRefresh=1
Chapter 14/HelloWorld.vbwWebClass1 = 0, 0, 0, 0, C, 0, 0, 0, 0, C
Chapter 14/listvideos.htm
Here is a list of video titles from our wide selection:
TitleRelease date
Table
Chapter 14/searchform.htm
Title:
Studio:
Chapter 14/searchform1.htm
Title:
Studio:
Chapter 14/VideoIIS.vbpType=OleDllReference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\WINDOWS\SYSTEM\STDOLE2.TLB#OLE AutomationReference=*\G{198887E2-AC76-11D0-A77C-00A024A55AB0}#1.0#0#..\..\..\PROGRAM FILES\COMMON FILES\DESIGNER\MSWCRUN.DLL#Microsoft WebClass LibraryReference=*\G{D97A6DA0-A85C-11CF-83AE-00A0C90C2BD8}#2.0#0#D:\Microsoft Visual Studio\Common\IDE\IDE98\ASP.TLB#Microsoft Active Server Pages Object LibraryDesigner=GetVideos.DsrStartup="(None)"HelpFile=""Title="Project1"Command32=""Name="VideoIIS"HelpContextID="0"CompatibleMode="1"MajorVer=1MinorVer=0RevisionVer=0AutoIncrementVer=0ServerSupportFiles=0VersionCompanyName="Wrox Press"CompilationType=0OptimizationType=0FavorPentiumPro(tm)=0CodeViewDebugInfo=0NoAliasing=0BoundsCheck=0OverflowCheck=0FlPointCheck=0FDIVCheck=0UnroundedFP=0StartMode=1Unattended=-1Retained=1ThreadPerObject=0MaxNumberOfThreads=1DebugStartupOption=1DebugStartupComponent=GetVideos
[MS Transaction Server]AutoRefresh=1
Chapter 14/WebClass1.DCA
Chapter 14/WebClass1.DsrVERSION 5.00Begin {17016CEE-E118-11D0-94B8-00A0C91110ED} WebClass1 ClientHeight = 5445 ClientLeft = 750 ClientTop = 1425 ClientWidth = 7320 _ExtentX = 12912 _ExtentY = 9604 MajorVersion = 0 MinorVersion = 8 StateManagementType= 1 ASPFileName = "" DIID_WebClass = "{12CBA1F6-9056-11D1-8544-00A024A55AB0}" DIID_WebClassEvents= "{12CBA1F5-9056-11D1-8544-00A024A55AB0}" TypeInfoCookie = 0 BeginProperty WebItems {193556CD-4486-11D1-9C70-00C04FB987DF} WebItemCount = 0 EndProperty NameInURL = "WebClass1"EndAttribute VB_Name = "WebClass1"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = TrueAttribute VB_PredeclaredId = FalseAttribute VB_Exposed = TrueOption ExplicitOption Compare Text
Private Sub WebClass_Start() 'Write a reply to the user With Response .Write "" .Write "" .Write "Hello world!
" .Write "This is our simple Hello world application.
" .Write "" .Write "" End With
End Sub
Chapter 13/GetVideo.asp
Chapter 13/GetVideos.asp
Title:
Studio:
Here is a list of video titles from our wide selection:
TitleRelease date
" %>
" & Video.ReleaseDate & "" Response.Write "" Next Set myVideos = Nothing %>
Chapter 12/VideoObjectsASP.dll
Chapter 12/VideoObjectsASP.expLD6.edatad@@.debug$Sm@BD6VideoObjectsASP.dllDllCanUnloadNowDllGetClassObjectDllRegisterServerDllUnregisterServer $(8, 0 Then _ strWHERE = "NAME LIKE '" & Name & "%' "
If Len(Phone) > 0 Then
If Len(strWHERE) > 0 Then strWHERE = strWHERE & " AND PHONE LIKE '" & Phone & "%'"
Else strWHERE = "PHONE LIKE '" & Phone & "%'"
End If
End If
If Len(strWHERE) > 0 Then _ strSQL = strSQL & " WHERE " & strWHERE Set rsCustomer = New Recordset rsCustomer.Open strSQL, DB_CONNECT Set mobjBuffer = New Buffer mobjBuffer.Initialize Len(udtData.Buffer), 100
Do While Not rsCustomer.EOF With udtProps .CustomerID = rsCustomer("CustomerID") .Name = rsCustomer("Name") .Phone = rsCustomer("Phone") End With LSet udtData = udtProps mobjBuffer.Add udtData.Buffer rsCustomer.MoveNext Loop
rsCustomer.Close Set rsCustomer = Nothing Fetch = mobjBuffer.GetState End Function
Chapter 12/VideoServerMTS/InvoiceFeePersist.clsVERSION 1.0 CLASSBEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 2 'RequiresTransactionENDAttribute VB_Name = "InvoiceFeePersist"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = TrueAttribute VB_PredeclaredId = FalseAttribute VB_Exposed = TrueOption Explicit
Implements ObjectControl
Private mobjContext As ObjectContextPrivate mudtProps As FeeProps
Private Sub SetState(Buffer As String)
Dim udtData As FeeData udtData.Buffer = Buffer LSet mudtProps = udtData
End Sub
Private Function GetState() As String
Dim udtData As FeeData LSet udtData = mudtProps GetState = udtData.Buffer
End Function
Friend Function Fetch(FeeID As Long) As String
Dim rsLateFee As Recordset Dim strSQL As String On Error GoTo errh strSQL = "SELECT LateFee.*, Video.Title " & _ "FROM (LateFee INNER JOIN Tape_ ON " & _ "LateFee.TapeID = Tape_.TapeID) " & _ "INNER JOIN Video ON Tape_.VideoID = Video.VideoID " & _ "WHERE LateFee.FeeID=" & Format$(FeeID) Set rsLateFee = New Recordset rsLateFee.Open strSQL, DB_CONNECT
With rsLateFee mudtProps.FeeID = .Fields("FeeID") mudtProps.VideoTitle = .Fields("Title") mudtProps.EnteredDate = .Fields("FeeDate") mudtProps.DaysOver = .Fields("DaysOver") mudtProps.Paid = .Fields("Paid") If Not IsNull(.Fields("PaidDate")) Then _ mudtProps.PaidDate = .Fields("PaidDate") .Close End With
Set rsLateFee = Nothing Fetch = GetState mobjContext.SetComplete Exit Function errh: mobjContext.SetAbort With Err .Raise .Number, .Source, .Description End With
End Function
Private Sub DeleteObject(FeeID As Long)
Dim rsLateFee As Recordset Dim strSQL As String Dim cnVideo As Connection
On Error GoTo errh cnVideo.Open DB_CONNECT
strSQL = "SELECT DELETED FROM LateFee WHERE FeeID=" & FeeID Set rsLateFee = New Recordset rsLateFee.Open strSQL, cnVideo
With rsLateFee .Fields("Deleted") = True .Update .Close End With cnVideo.Close Set cnVideo = Nothing mobjContext.SetComplete Exit Sub errh: mobjContext.SetAbort With Err .Raise .Number, .Source, .Description End With
End Sub
Friend Function Save(Buffer As String) As String
Dim rsLateFee As Recordset Dim strSQL As String On Error GoTo errh SetState Buffer If mudtProps.IsDeleted Then DeleteObject mudtProps.FeeID Exit Function End If strSQL = "SELECT * FROM LateFee WHERE FeeID=" & _ mudtProps.FeeID Set rsLateFee = New Recordset rsLateFee.Open strSQL, DB_CONNECT, adOpenKeyset, adLockOptimistic If mudtProps.IsNew Then rsLateFee.AddNew
With rsLateFee .Fields("Paid") = mudtProps.Paid .Fields("PaidDate") = mudtProps.PaidDate .Update If mudtProps.IsNew Then .Bookmark = .Bookmark mudtProps.FeeID = .Fields("FeeID") End If .Close End With
Set rsLateFee = Nothing Save = GetState mobjContext.SetComplete Exit Function errh: mobjContext.SetAbort With Err .Raise .Number, .Source, .Description End With
End Function
Private Function ObjectControl_CanBePooled() As Boolean
ObjectControl_CanBePooled = False End Function
Private Sub ObjectControl_Activate()
Set mobjContext = GetObjectContext
End Sub
Private Sub ObjectControl_Deactivate()
Set mobjContext = Nothing
End Sub
Chapter 12/VideoServerMTS/InvoiceItemsPersist.clsVERSION 1.0 CLASSBEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 2 'RequiresTransactionENDAttribute VB_Name = "InvoiceItemsPersist"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = TrueAttribute VB_PredeclaredId = FalseAttribute VB_Exposed = TrueOption Explicit
Implements ObjectControl
Private mobjContext As ObjectContext
Public Function FetchTapes(InvoiceID As Long) As String
Dim rsItems As Recordset Dim strSQL As String Dim objBuffer As Buffer Dim udtProps As InvoiceTapeProps Dim objPersist As InvoiceTapePersist
On Error GoTo errh strSQL = "SELECT ITEMID FROM INVOICETAPE " & _ "WHERE INVOICEID=" & InvoiceID Set rsItems = New Recordset rsItems.Open strSQL, DB_CONNECT Set objBuffer = New Buffer objBuffer.Initialize Len(udtProps), 10 Set objPersist = CreateObject("VideoserverMTS.InvoiceTapePersist")
Do While Not rsItems.EOF objBuffer.Add objPersist.Fetch(rsItems("ItemID")) Loop
rsItems.Close Set rsItems = Nothing FetchTapes = objBuffer.GetState mobjContext.SetComplete Exit Function errh: mobjContext.SetAbort With Err .Raise .Number, .Source, .Description End With
End Function
Public Function FetchFees(CustomerID As Long) As String
Dim rsItems As Recordset Dim strSQL As String Dim objBuffer As Buffer Dim udtProps As FeeProps Dim objPersist As InvoiceFeePersist
On Error GoTo errh strSQL = "SELECT FEEID FROM LATEFEE " & _ "WHERE DELETED=0 AND PAID=0 AND " & _ "CUSTOMERID=" & CustomerID Set rsItems = New Recordset rsItems.Open strSQL, DB_CONNECT Set objBuffer = New Buffer objBuffer.Initialize Len(udtProps), 10 Set objPersist = CreateObject("VideoserverMTS.InvoiceFeePersist") Do While Not rsItems.EOF objBuffer.Add objPersist.Fetch(rsItems("FeeID")) rsItems.MoveNext Loop
rsItems.Close Set rsItems = Nothing FetchFees = objBuffer.GetState mobjContext.SetComplete Exit Function errh: mobjContext.SetAbort With Err .Raise .Number, .Source, .Description End With
End Function
Public Function SaveTapes(InvoiceID As Long, Buffer As String) As String
Dim objBuffer As Buffer Dim objUpdatedTapes As Buffer Dim objPersist As InvoiceTapePersist Dim lngIndex As Long Dim strBuffer As String
On Error GoTo errh Set objBuffer = New Buffer Set objUpdatedTapes = New Buffer objBuffer.SetState Buffer objUpdatedTapes.Initialize objBuffer.Length, objBuffer.Count Set objPersist = New InvoiceTapePersist
For lngIndex = 1 To objBuffer.Count With objPersist strBuffer = .Save(InvoiceID, objBuffer.Item(lngIndex)) If Len(strBuffer) > 0 Then _ objUpdatedTapes.Add strBuffer End With Next
Set objPersist = Nothing SaveTapes = objUpdatedTapes.GetState mobjContext.SetComplete Exit Function errh: mobjContext.SetAbort With Err .Raise .Number, .Source, .Description End With
End Function
Public Function SaveFees(Buffer As String) As String
Dim objBuffer As Buffer Dim objUpdatedFees As Buffer Dim objPersist As InvoiceFeePersist Dim lngIndex As Long Dim strBuffer As String
On Error GoTo errh Set objBuffer = New Buffer Set objUpdatedFees = New Buffer objBuffer.SetState Buffer objUpdatedFees.Initialize objBuffer.Length, objBuffer.Count Set objPersist = New InvoiceFeePersist
For lngIndex = 1 To objBuffer.Count With objPersist strBuffer = .Save(objBuffer.Item(lngIndex)) If Len(strBuffer) > 0 Then _ objUpdatedFees.Add strBuffer End With Next
Set objPersist = Nothing SaveFees = objUpdatedFees.GetState mobjContext.SetComplete Exit Function errh: mobjContext.SetAbort With Err .Raise .Number, .Source, .Description End With
End Function
Private Function ObjectControl_CanBePooled() As Boolean
ObjectControl_CanBePooled = False End Function
Private Sub ObjectControl_Activate()
Set mobjContext = GetObjectContext
End Sub
Private Sub ObjectControl_Deactivate()
Set mobjContext = Nothing
End Sub
Chapter 12/VideoServerMTS/InvoicePersist.clsVERSION 1.0 CLASSBEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 2 'RequiresTransactionENDAttribute VB_Name = "InvoicePersist"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = TrueAttribute VB_PredeclaredId = FalseAttribute VB_Exposed = TrueOption Explicit
Implements ObjectControl
Private mobjContext As ObjectContextPrivate mudtProps As InvoiceProps
Private Function GetState() As String
Dim udtData As InvoiceData
LSet udtData = mudtProps GetState = udtData.Buffer
End Function
Private Sub SetState(Buffer As String)
Dim udtData As InvoiceData udtData.Buffer = Buffer LSet mudtProps = udtData
End Sub
Public Function Save(ByVal Buffer As String) As String
Dim rsInvoice As Recordset Dim strSQL As String On Error GoTo errh SetState Buffer strSQL = "SELECT * FROM Invoice WHERE InvoiceID=" & mudtProps.InvoiceID Set rsInvoice = New Recordset rsInvoice.Open strSQL, DB_CONNECT, adOpenKeyset, adLockOptimistic If mudtProps.IsNew Then rsInvoice.AddNew
With rsInvoice .Fields("CustomerID") = mudtProps.CustomerID .Fields("Subtotal") = mudtProps.SubTotal .Fields("Tax") = mudtProps.Tax .Fields("Total") = mudtProps.Total .Update If mudtProps.IsNew Then .Bookmark = .Bookmark mudtProps.InvoiceID = .Fields("InvoiceID") End If .Close End With
strSQL = "SELECT NAME,PHONE FROM Customer " & _ "WHERE CustomerID=" & mudtProps.CustomerID rsInvoice.Open strSQL, DB_CONNECT mudtProps.CustomerName = rsInvoice("Name") mudtProps.CustomerPhone = rsInvoice("Phone") rsInvoice.Close Set rsInvoice = Nothing Save = GetState mobjContext.SetComplete Exit Function errh: mobjContext.SetAbort With Err .Raise .Number, .Source, .Description End With
End Function
Public Sub DeleteObject(ByVal InvoiceID As Long)
Dim cnVideo As Connection
On Error GoTo errh cnVideo.Open DB_CONNECT
cnVideo.Execute "DELETE FROM Invoice WHERE InvoiceID=" & _ InvoiceID cnVideo.Close Set cnVideo = Nothing mobjContext.SetComplete Exit Sub errh: mobjContext.SetAbort With Err .Raise .Number, .Source, .Description End With
End Sub
Public Function Fetch(ByVal InvoiceID As Long) As String
Dim rsInvoice As Recordset Dim strSQL As String On Error GoTo errh strSQL = "SELECT Invoice.*,Customer.Name,Customer.Phone " & _ "FROM Invoice INNER JOIN Customer ON " & _ "Invoice.CustomerID = Customer.CustomerID " & _ "WHERE InvoiceID=" & CStr(InvoiceID) Set rsInvoice = New Recordset rsInvoice.Open strSQL, DB_CONNECT With rsInvoice mudtProps.InvoiceID = .Fields("InvoiceID") mudtProps.CustomerID = .Fields("CustomerID") mudtProps.CustomerName = .Fields("Name") mudtProps.CustomerPhone = .Fields("Phone") .Close End With
Set rsInvoice = Nothing Fetch = GetState mobjContext.SetComplete Exit Function errh: mobjContext.SetAbort With Err .Raise .Number, .Source, .Description End With
End Function
Private Function ObjectControl_CanBePooled() As Boolean
ObjectControl_CanBePooled = False End Function
Private Sub ObjectControl_Activate()
Set mobjContext = GetObjectContext
End Sub
Private Sub ObjectControl_Deactivate()
Set mobjContext = Nothing
End Sub
Chapter 12/VideoServerMTS/InvoiceTapePersist.clsVERSION 1.0 CLASSBEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 2 'RequiresTransactionENDAttribute VB_Name = "InvoiceTapePersist"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = TrueAttribute VB_PredeclaredId = FalseAttribute VB_Exposed = TrueOption Explicit
Implements ObjectControl
Private mobjContext As ObjectContextPrivate mudtProps As InvoiceTapeProps
Private Sub SetState(Buffer As String)
Dim udtData As InvoiceTapeData udtData.Buffer = Buffer LSet mudtProps = udtData
End Sub
Private Function GetState() As String
Dim udtData As InvoiceTapeData LSet udtData = mudtProps GetState = udtData.Buffer
End Function
Private Sub DeleteObject(ItemID As Long)
Dim cnVideo As Connection
cnVideo.Open DB_CONNECT
cnVideo.Execute "DELETE FROM InvoiceTape WHERE ItemID=" & _ CStr(ItemID) cnVideo.Close Set cnVideo = Nothing mobjContext.SetComplete
End Sub
Friend Function Fetch(ItemID As Long) As String
Dim rsInvoiceTape As Recordset Dim strSQL As String strSQL = "SELECT InvoiceTape.*, Video.Title " & _ "FROM (InvoiceTape INNER JOIN Tape_ ON " & _ "InvoiceTape.TapeID = Tape_.TapeID) " & _ "INNER JOIN Video ON Tape_.VideoID = Video.VideoID " & _ "WHERE InvoiceTape.ItemID=" & ItemID Set rsInvoiceTape = New Recordset rsInvoiceTape.Open strSQL, DB_CONNECT
With rsInvoiceTape mudtProps.ItemID = .Fields("ItemID") mudtProps.TapeID = .Fields("TapeID") mudtProps.Title = .Fields("Title") mudtProps.Price = .Fields("Price") .Close End With
Set rsInvoiceTape = Nothing Fetch = GetState mobjContext.SetComplete
End Function
Friend Function Save(InvoiceID As Long, Buffer As String) As String
Dim rsInvoiceTape As Recordset Dim strSQL As String Dim objPersist As TapePersist SetState Buffer If mudtProps.IsDeleted Then DeleteObject mudtProps.ItemID Exit Function End If strSQL = "SELECT * FROM InvoiceTape WHERE ItemID=" & _ CStr(mudtProps.ItemID) Set rsInvoiceTape = New Recordset rsInvoiceTape.Open strSQL, DB_CONNECT, adOpenKeyset, adLockOptimistic If mudtProps.IsNew Then rsInvoiceTape.AddNew
With rsInvoiceTape .Fields("InvoiceID") = InvoiceID .Fields("TapeID") = mudtProps.TapeID .Fields("Price") = mudtProps.Price .Update If mudtProps.IsNew Then .Bookmark = .Bookmark mudtProps.ItemID = .Fields("ItemID") End If .Close End With Set objPersist = New TapePersist objPersist.CheckOut mudtProps.TapeID, InvoiceID Set objPersist = Nothing
If mudtProps.IsNew Then strSQL = "SELECT Video.Title " & _ "FROM Tape_ INNER JOIN Video ON " & _ "Tape_.VideoID = Video.VideoID " & _ "WHERE Tape_.TapeID=" & mudtProps.TapeID rsInvoiceTape.Open strSQL, DB_CONNECT mudtProps.Title = rsInvoiceTape("Title") rsInvoiceTape.Close End If Set rsInvoiceTape = Nothing Save = GetState mobjContext.SetComplete
End Function
Private Function ObjectControl_CanBePooled() As Boolean
ObjectControl_CanBePooled = False End Function
Private Sub ObjectControl_Activate()
Set mobjContext = GetObjectContext
End Sub
Private Sub ObjectControl_Deactivate()
Set mobjContext = Nothing
End Sub
Chapter 12/VideoServerMTS/TapePersist.clsVERSION 1.0 CLASSBEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 3 'UsesTransactionENDAttribute VB_Name = "TapePersist"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = TrueAttribute VB_PredeclaredId = FalseAttribute VB_Exposed = TrueOption Explicit
Implements ObjectControl
Private mobjContext As ObjectContextPrivate mudtProps As TapeProps
Private Sub SetState(Buffer As String)
Dim udtData As TapeData udtData.Buffer = Buffer LSet mudtProps = udtData
End Sub
Private Function GetState() As String
Dim udtData As TapeData LSet udtData = mudtProps GetState = udtData.Buffer
End Function
Public Function Fetch(ByVal TapeID As Long) As String
Dim objPersist As TapePersist Dim rsTape As Recordset Dim strSQL As String On Error GoTo errh strSQL = "SELECT Tape_.*,Video.Title " & _ "FROM Tape_ INNER JOIN Video ON " & _ "Tape_.VideoID = Video.VideoID " & _ "WHERE TapeID=" & TapeID Set rsTape = New Recordset rsTape.Open strSQL, DB_CONNECT
With rsTape mudtProps.TapeID = .Fields("TapeID") mudtProps.VideoID = .Fields("VideoID") mudtProps.Title = .Fields("Title") mudtProps.CheckedOut = .Fields("CheckedOut") mudtProps.DateAcquired = IIf(IsNull(.Fields("DateAcquired")), 0, _ .Fields("DateAcquired")) mudtProps.DateDue = IIf(IsNull(.Fields("DateDue")), 0, .Fields("DateDue")) mudtProps.InvoiceID = .Fields("InvoiceID") rsTape.Close End With
Set rsTape = Nothing Fetch = GetState mobjContext.SetComplete Exit Function errh: mobjContext.SetAbort With Err .Raise .Number, .Source, .Description End With
End Function
Public Function Save(ByVal Buffer As String) As String
Dim rsTape As Recordset Dim rsVideo As Recordset Dim strSQL As String On Error GoTo errh SetState Buffer strSQL = "SELECT * FROM Tape_ WHERE TapeID=" & mudtProps.TapeID Set rsTape = New Recordset rsTape.Open strSQL, DB_CONNECT, adOpenKeyset, adLockOptimistic If mudtProps.IsNew Then rsTape.AddNew With rsTape .Fields("VideoID") = mudtProps.VideoID .Fields("CheckedOut") = mudtProps.CheckedOut .Fields("DateAcquired") = mudtProps.DateAcquired .Fields("DateDue") = mudtProps.DateDue .Fields("InvoiceID") = mudtProps.InvoiceID .Update If mudtProps.IsNew Then .Bookmark = .Bookmark mudtProps.TapeID = .Fields("TapeID") End If .Close End With
Set rsTape = Nothing If mudtProps.IsNew Then strSQL = "SELECT TITLE FROM Video WHERE VideoID=" & _ mudtProps.VideoID Set rsVideo = New Recordset rsVideo.Open strSQL, DB_CONNECT mudtProps.Title = rsVideo("Title") rsVideo.Close Set rsVideo = Nothing End If Save = GetState If mudtProps.LateFee Then ' add the late fee to the customer SaveLateFee End If mobjContext.SetComplete Exit Function errh: mobjContext.SetAbort With Err .Raise .Number, .Source, .Description End With
End Function
Private Sub SaveLateFee()
Dim rsLateFee As Recordset Dim rsInvoice As Recordset Dim strSQL As String strSQL = "SELECT CUSTOMERID FROM INVOICE WHERE INVOICEID=" & _ mudtProps.InvoiceID Set rsInvoice = New Recordset rsInvoice.Open strSQL, DB_CONNECT strSQL = "LateFee" Set rsLateFee = New Recordset rsLateFee.Open strSQL, DB_CONNECT, adOpenKeyset, adLockOptimistic rsLateFee.AddNew
With rsLateFee .Fields("CustomerID") = rsInvoice("CustomerID") .Fields("TapeID") = mudtProps.TapeID .Fields("FeeDate") = Now .Fields("DaysOver") = DateDiff("d", mudtProps.DateDue, Now) .Fields("Paid") = False .Update .Close End With
rsInvoice.Close Set rsInvoice = Nothing Set rsLateFee = Nothing mobjContext.SetComplete
End Sub
Public Sub DeleteObject(ByVal TapeID As Long)
Dim cnVideo As Connection
On Error GoTo errh Set cnVideo = New Connection cnVideo.Open DB_CONNECT cnVideo.Execute "DELETE FROM Tape_ WHERE TapeID=" & TapeID cnVideo.Close Set cnVideo = Nothing mobjContext.SetComplete Exit Sub errh: mobjContext.SetAbort With Err .Raise .Number, .Source, .Description End With
End Sub
Public Function SaveChild(VideoID As Long, Buffer As String) As String
On Error GoTo errh SetState Buffer
With mudtProps If .IsDeleted Then DeleteObject .TapeID SaveChild = ""
ElseIf .IsDirty Or .IsNew Then .VideoID = VideoID SaveChild = Save(GetState)
Else SaveChild = Buffer mobjContext.SetComplete
End If
End With Exit Function errh: mobjContext.SetAbort With Err .Raise .Number, .Source, .Description End With
End Function
Public Sub CheckOut(TapeID As Long, InvoiceID As Long)
Dim rsTape As Recordset Dim strSQL As String On Error GoTo errh strSQL = "SELECT * FROM Tape_ WHERE TapeID=" & TapeID Set rsTape = New Recordset rsTape.Open strSQL, DB_CONNECT, adOpenKeyset, adLockOptimistic
With rsTape .Fields("CheckedOut") = True .Fields("DateDue") = DateAdd("d", 2, Now) .Fields("InvoiceID") = InvoiceID .Update .Close End With
Set rsTape = Nothing mobjContext.SetComplete Exit Sub errh: mobjContext.SetAbort With Err .Raise .Number, .Source, .Description End With
End Sub
Private Function ObjectControl_CanBePooled() As Boolean
ObjectControl_CanBePooled = False End Function
Private Sub ObjectControl_Activate()
Set mobjContext = GetObjectContext
End Sub
Private Sub ObjectControl_Deactivate()
Set mobjContext = Nothing
End Sub
Chapter 12/VideoServerMTS/TapesPersist.clsVERSION 1.0 CLASSBEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 2 'RequiresTransactionENDAttribute VB_Name = "TapesPersist"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = TrueAttribute VB_PredeclaredId = FalseAttribute VB_Exposed = TrueOption Explicit
Implements ObjectControl
Private mobjContext As ObjectContext
Public Function Fetch(ByVal VideoID As Long) As String
Dim strSQL As String Dim rsTape As Recordset Dim objBuffer As Buffer Dim objPersist As TapePersist Dim udtProps As TapeProps
On Error GoTo errh Set objBuffer = New Buffer strSQL = "SELECT TapeID FROM Tape_ WHERE VideoID=" & VideoID Set rsTape = New Recordset rsTape.Open strSQL, DB_CONNECT Set objPersist = mobjContext.CreateInstance("VideoServerMTS.TapePersist")
With objPersist objBuffer.Initialize Len(udtProps), 20
Do While Not rsTape.EOF objBuffer.Add .Fetch(rsTape("TapeID")) rsTape.MoveNext Loop
End With
Set objPersist = Nothing rsTape.Close Set rsTape = Nothing Fetch = objBuffer.GetState mobjContext.SetComplete Exit Function errh: mobjContext.SetAbort With Err .Raise .Number, .Source, .Description End With
End Function
Public Function Save(ByVal VideoID As Long, ByVal Buffer As String) As String
Dim objPersist As TapePersist Dim objBuffer As Buffer Dim objUpdatedTapes As Buffer Dim lngIndex As Long Dim strBuffer As String
On Error GoTo errh Set objBuffer = New Buffer objBuffer.SetState Buffer Set objUpdatedTapes = New Buffer objUpdatedTapes.Initialize objBuffer.Length, objBuffer.Count Set objPersist = mobjContext.CreateInstance("VideoServerMTS.TapePersist")
For lngIndex = 1 To objBuffer.Count With objPersist strBuffer = .SaveChild(VideoID, objBuffer.Item(lngIndex)) If Len(strBuffer) > 0 Then _ objUpdatedTapes.Add strBuffer End With
Next
Set objPersist = Nothing Save = objUpdatedTapes.GetState mobjContext.SetComplete Exit Function errh: mobjContext.SetAbort With Err .Raise .Number, .Source, .Description End With
End Function
Private Function ObjectControl_CanBePooled() As Boolean
ObjectControl_CanBePooled = False End Function
Private Sub ObjectControl_Activate()
Set mobjContext = GetObjectContext
End Sub
Private Sub ObjectControl_Deactivate()
Set mobjContext = Nothing
End Sub
Chapter 12/VideoServerMTS/TextListPersist.clsVERSION 1.0 CLASSBEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 3 'UsesTransactionENDAttribute VB_Name = "TextListPersist"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = TrueAttribute VB_PredeclaredId = FalseAttribute VB_Exposed = TrueOption Explicit
Private mobjBuffer As Buffer
Public Function Fetch(ByVal ListName As String) As String
Dim strSQL As String Dim rsList As Recordset Dim udtProps As TextListProps Dim udtData As TextListData
Set mobjBuffer = New Buffer mobjBuffer.Initialize Len(udtData), 50 Set rsList = New Recordset rsList.Open ListName, DB_CONNECT
Do While Not rsList.EOF With udtProps .Item = rsList(1) .Key = rsList(0) End With
LSet udtData = udtProps mobjBuffer.Add udtData.Buffer rsList.MoveNext Loop
rsList.Close Set rsList = Nothing Fetch = mobjBuffer.GetState
End Function
Chapter 12/VideoServerMTS/VideoPersist.clsVERSION 1.0 CLASSBEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 2 'RequiresTransactionENDAttribute VB_Name = "VideoPersist"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = TrueAttribute VB_PredeclaredId = FalseAttribute VB_Exposed = TrueOption Explicit
Implements ObjectControl
Private mobjContext As ObjectContextPrivate mudtProps As VideoProps
Public Function Save(ByVal Buffer As String, TapeBuffer As String) As String
Dim rsVideo As Recordset Dim strSQL As String Dim objPersist As TapesPersist
On Error GoTo errh SetState Buffer Set rsVideo = New Recordset strSQL = "SELECT * FROM Video WHERE VideoID=" & mudtProps.VideoID rsVideo.Open strSQL, DB_CONNECT, adOpenKeyset, adLockOptimistic If mudtProps.IsNew Then rsVideo.AddNew With rsVideo .Fields("Title") = mudtProps.Title .Fields("ReleaseDate") = mudtProps.ReleaseDate .Fields("Studio") = mudtProps.Studio .Fields("Rating") = mudtProps.Rating .Fields("Category") = mudtProps.Category .Update If mudtProps.IsNew Then .Bookmark = .Bookmark mudtProps.VideoID = .Fields("VideoID") End If .Close End With
Set rsVideo = Nothing Save = GetState Set objPersist = mobjContext.CreateInstance("VideoServerMTS.TapesPersist") TapeBuffer = objPersist.Save(mudtProps.VideoID, TapeBuffer) Set objPersist = Nothing mobjContext.SetComplete Exit Function errh: mobjContext.SetAbort With Err .Raise .Number, .Source, .Description End With
End Function
Public Sub DeleteObject(ByVal VideoID As Long)
Dim cnVideo As Connection
On Error GoTo errh 'Set cnVideo = New Connection cnVideo.Open DB_CONNECT cnVideo.Execute "DELETE FROM Video WHERE VideoID=" & VideoID cnVideo.Close Set cnVideo = Nothing mobjContext.SetComplete Exit Sub errh: mobjContext.SetAbort With Err .Raise .Number, .Source, .Description End With End Sub
Public Function Fetch(ByVal VideoID As Long) As String
Dim rsVideo As Recordset Dim strSQL As String On Error GoTo errh strSQL = "SELECT * FROM Video WHERE VideoID=" & VideoID Set rsVideo = New Recordset rsVideo.Open strSQL, DB_CONNECT
With rsVideo mudtProps.VideoID = .Fields("VideoID") mudtProps.Title = .Fields("Title") mudtProps.ReleaseDate = IIf(IsNull(.Fields("ReleaseDate")), 0, _ .Fields("ReleaseDate")) mudtProps.Studio = .Fields("Studio") mudtProps.Rating = .Fields("Rating") mudtProps.Category = .Fields("Category") rsVideo.Close End With
Set rsVideo = Nothing Fetch = GetState mobjContext.SetComplete Exit Function errh: mobjContext.SetAbort With Err .Raise .Number, .Source, .Description End With
End Function
Private Sub SetState(Buffer As String)
Dim udtData As VideoData udtData.Buffer = Buffer LSet mudtProps = udtData
End Sub
Private Function GetState() As String
Dim udtData As VideoData LSet udtData = mudtProps GetState = udtData.Buffer
End Function
Private Function ObjectControl_CanBePooled() As Boolean
ObjectControl_CanBePooled = False End Function
Private Sub ObjectControl_Activate()
Set mobjContext = GetObjectContext
End Sub
Private Sub ObjectControl_Deactivate()
Set mobjContext = Nothing
End Sub
Chapter 12/VideoServerMTS/VideoServer.vbpType=OleDllReference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\WINDOWS\SYSTEM\STDOLE2.TLB#OLE AutomationReference=*\G{00000200-0000-0010-8000-00AA006D2EA4}#2.0#0#..\..\..\..\PROGRAM FILES\COMMON FILES\SYSTEM\ADO\MSADO15.DLL#Microsoft ActiveX Data Objects 2.0 LibraryReference=*\G{74C08640-CEDB-11CF-8B49-00AA00B8A790}#1.0#0#..\..\..\..\Program Files\Remote Applications\{DE65703F-56F3-11D2-8A11-00A0C9AFA93B}\mtxas.dll#Microsoft Transaction Server Type LibraryClass=CustomerPersist; CustomerPersist.clsModule=VOmain; VOmain.basClass=Buffer; Buffer.clsClass=TextListPersist; TextListPersist.clsClass=CustomersPersist; CustomersPersist.clsClass=VideosPersist; VideosPersist.clsClass=VideoPersist; VideoPersist.clsClass=TapesPersist; TapesPersist.clsClass=TapePersist; TapePersist.clsClass=InvoicePersist; InvoicePersist.clsClass=InvoiceTapePersist; InvoiceTapePersist.clsClass=InvoiceFeePersist; InvoiceFeePersist.clsClass=InvoiceItemsPersist; InvoiceItemsPersist.clsModule=VideoTypes; VideoTypes.basStartup="(None)"HelpFile=""ExeName32="VideoServerMTS.dll"Command32=""Name="VideoServerMTS"HelpContextID="0"CompatibleMode="0"CompatibleEXE32="Copy of VideoServerMTS.dll"MajorVer=1MinorVer=0RevisionVer=0AutoIncrementVer=0ServerSupportFiles=1VersionCompanyName="4"CompilationType=0OptimizationType=0FavorPentiumPro(tm)=0CodeViewDebugInfo=0NoAliasing=0BoundsCheck=0OverflowCheck=0FlPointCheck=0FDIVCheck=0UnroundedFP=0StartMode=1Unattended=-1Retained=0ThreadPerObject=-1MaxNumberOfThreads=1
[MS Transaction Server]AutoRefresh=1
Chapter 12/VideoServerMTS/VideosPersist.clsVERSION 1.0 CLASSBEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 3 'UsesTransactionENDAttribute VB_Name = "VideosPersist"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = TrueAttribute VB_PredeclaredId = FalseAttribute VB_Exposed = TrueOption Explicit
Implements ObjectControl
Private mobjContext As ObjectContextPrivate mobjBuffer As Buffer
Public Function Fetch(ByVal Title As String, ByVal Studio As String) As String
Dim rsVideo As Recordset Dim strSQL As String Dim strWHERE As String' Dim objDisplay As VideoDisplay Dim udtData As VideoDisplayData Dim udtProps As VideoDisplayProps On Error GoTo errh strSQL = "SELECT VideoID, TITLE,RELEASEDATE FROM Video" If Len(Title) > 0 Then _ strWHERE = "TITLE LIKE '" & Title & "%' "
If Len(Studio) > 0 Then If Len(strWHERE) > 0 Then strWHERE = strWHERE & " AND STUDIO LIKE '" & Studio & "%'"
Else strWHERE = "STUDIO LIKE '" & Studio & "%'"
End If
End If
If Len(strWHERE) > 0 Then _ strSQL = strSQL & " WHERE " & strWHERE Set rsVideo = New Recordset rsVideo.Open strSQL, DB_CONNECT Set mobjBuffer = New Buffer mobjBuffer.Initialize Len(udtData.Buffer), 100
Do While Not rsVideo.EOF With udtProps .VideoID = rsVideo("VideoID") .Title = rsVideo("Title") .ReleaseDate = rsVideo("ReleaseDate") End With LSet udtData = udtProps mobjBuffer.Add udtData.Buffer rsVideo.MoveNext Loop
rsVideo.Close Set rsVideo = Nothing Fetch = mobjBuffer.GetState mobjContext.SetComplete Exit Function errh: mobjContext.SetAbort With Err .Raise .Number, .Source, .Description End With
End Function
Private Function ObjectControl_CanBePooled() As Boolean
ObjectControl_CanBePooled = False End Function
Private Sub ObjectControl_Activate()
Set mobjContext = GetObjectContext
End Sub
Private Sub ObjectControl_Deactivate()
Set mobjContext = Nothing
End Sub
Chapter 12/VideoServerMTS/VideoTypes.basAttribute VB_Name = "VideoTypes"Option Explicit
Public Type CustomerProps CustomerID As Long Name As String * 50 Phone As String * 25 Address1 As String * 30 Address2 As String * 30 City As String * 20 State As String * 2 ZipCode As String * 10 IsNew As Boolean IsDeleted As Boolean IsDirty As BooleanEnd Type
Public Type CustomerData Buffer As String * 172End Type
Public Type TextListProps Key As String * 30 Item As String * 255End Type
Public Type TextListData Buffer As String * 285End Type
Public Type CustDisplayProps CustomerID As Long Name As String * 50 Phone As String * 25End Type
Public Type CustDisplayData Buffer As String * 78End Type
Public Type VideoDisplayProps VideoID As Long Title As String * 30 ReleaseDate As DateEnd Type
Public Type VideoDisplayData Buffer As String * 36End Type
Public Type VideoProps VideoID As Long Title As String * 30 ReleaseDate As Date Studio As String * 30 Category As String * 20 Rating As String * 5 IsNew As Boolean IsDeleted As Boolean IsDirty As BooleanEnd Type
Public Type VideoData Buffer As String * 94End Type
Public Type TapeProps TapeID As Long VideoID As Long Title As String * 30 CheckedOut As Boolean DateAcquired As Date DateDue As Date LateFee As Boolean InvoiceID As Long IsNew As Boolean IsDeleted As Boolean IsDirty As BooleanEnd Type
Public Type TapeData Buffer As String * 52End Type
Public Type InvoiceProps InvoiceID As Long CustomerID As Long CustomerName As String * 50 CustomerPhone As String * 25 SubTotal As Double Tax As Double Total As Double IsNew As Boolean IsDeleted As Boolean IsDirty As BooleanEnd Type
Public Type InvoiceData Buffer As String * 96End Type
Public Type FeeProps InvoiceID As Long FeeID As Long VideoTitle As String * 30 EnteredDate As Date DaysOver As Integer Paid As Boolean PaidDate As Date IsNew As Boolean IsDeleted As Boolean IsDirty As BooleanEnd Type
Public Type FeeData Buffer As String * 48End Type
Public Type InvoiceTapeProps InvoiceID As Long ItemID As Long TapeID As Long Title As String * 30 Price As Double IsNew As Boolean IsDeleted As Boolean IsDirty As BooleanEnd Type
Public Type InvoiceTapeData Buffer As String * 44End Type
Chapter 12/VideoServerMTS/VOmain.basAttribute VB_Name = "VOmain"Option Explicit
Public Const DB_CONNECT = "PROVIDER=SQLOLEDB;Data Source=MYSERVER;" & _ "Initial Catalog=Video;User id=VideoApp;Password=password;"
Chapter 12/VideoObjectsMTS/BrokenRules.clsVERSION 1.0 CLASSBEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObjectENDAttribute VB_Name = "BrokenRules"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = TrueAttribute VB_PredeclaredId = FalseAttribute VB_Exposed = TrueOption Explicit
Event BrokenRule()Event NoBrokenRules()
Private mcolBroken As Collection
Private Sub Class_Initialize()
Set mcolBroken = New Collection
End Sub
Public Sub RuleBroken(Rule As String, IsBroken As Boolean) On Error GoTo HandleError
If IsBroken Then mcolBroken.Add True, Rule RaiseEvent BrokenRule
Else mcolBroken.Remove Rule If mcolBroken.Count = 0 Then RaiseEvent NoBrokenRules
End If
HandleError:
End Sub
Public Property Get Count() As Integer
Count = mcolBroken.Count
End Property
Chapter 12/VideoObjectsMTS/Buffer.clsVERSION 1.0 CLASSBEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObjectENDAttribute VB_Name = "Buffer"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = FalseAttribute VB_Exposed = FalseOption Explicit
Private Type BufferProps Length As Integer EstCount As Long MaxCount As Long Count As LongEnd Type
Private Type BufferData Buffer As String * 8End Type
Private Const BUFFER_START = 9Private mstrBuffer As StringPrivate mudtProps As BufferPropsPrivate mlngPos As Long
Public Sub Initialize(Length As Integer, EstimatedCount As Long)
With mudtProps .Length = Length .EstCount = EstimatedCount .MaxCount = EstimatedCount .Count = 0 mstrBuffer = Space$(BUFFER_START + .MaxCount * .Length) mlngPos = BUFFER_START End With
End Sub
Public Sub Add(Data As String)
With mudtProps If .Count = .MaxCount Then mstrBuffer = mstrBuffer & _ Space$(mudtProps.EstCount / 2 * mudtProps.Length) .MaxCount = .MaxCount + mudtProps.EstCount / 2 End If
Mid$(mstrBuffer, mlngPos, .Length) = Data mlngPos = mlngPos + .Length .Count = .Count + 1 End With
End Sub
Public Function GetState() As String
Dim udtData As BufferData
LSet udtData = mudtProps Mid$(mstrBuffer, 1, Len(udtData.Buffer)) = udtData.Buffer GetState = Left$(mstrBuffer, mlngPos)
End Function
Public Sub SetState(Buffer As String)
Dim udtData As BufferData udtData.Buffer = Mid$(Buffer, 1, Len(udtData.Buffer)) LSet mudtProps = udtData mstrBuffer = Buffer
End Sub
Public Property Get Item(Index As Long) As String
Item = Mid$(mstrBuffer, BUFFER_START + (Index - 1) * _ mudtProps.Length, mudtProps.Length)
End Property
Public Function Count() As Long
Count = mudtProps.Count
End Function
Public Function Length() As Long
Length = mudtProps.Length
End Function
Public Property Let Item(Index As Long, Buffer As String)
Mid$(mstrBuffer, BUFFER_START + (Index - 1) * _ mudtProps.Length, mudtProps.Length) = Buffer
End Property
Chapter 12/VideoObjectsMTS/Business.clsVERSION 1.0 CLASSBEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObjectENDAttribute VB_Name = "Business"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = TrueAttribute VB_PredeclaredId = FalseAttribute VB_Exposed = TrueOption Explicit
Event Valid(IsValid As Boolean)
Private mflgNew As BooleanPrivate mflgDeleted As BooleanPrivate mflgDirty As BooleanPrivate mflgEditing As BooleanPrivate WithEvents mobjValid As BrokenRulesAttribute mobjValid.VB_VarHelpID = -1
Public Sub BeginEdit()
If mflgEditing Then Err.Raise 445 ' save object state mflgEditing = True
End Sub
Public Sub CancelEdit()
If Not mflgEditing Then Err.Raise 445 mflgEditing = False mflgDeleted = False mflgDirty = False ' restore object state
End Sub
Public Sub ApplyEdit()
If Not mflgEditing Then Err.Raise 445
If mflgDeleted And Not mflgNew Then ' code to delete the object's data goes here mflgNew = True mflgDeleted = False
ElseIf mflgDirty Or mflgNew Then If Not IsValid Then Err.Raise 445 ' save object to database if appropriate ' save object state mflgNew = False
End If
mflgDirty = False mflgEditing = False
End Sub
Private Sub Class_Initialize()
mflgNew = True Set mobjValid = New BrokenRules ' if we know any rules are broken on startup ' then add code here to initialize the list ' of broken rules ' ' mobjValid.RuleBroken "RuleName", True
End Sub
Public Property Get IsValid() As Boolean
IsValid = (mobjValid.Count = 0)
End Property
Private Sub mobjValid_BrokenRule()
RaiseEvent Valid(False)
End Sub
Private Sub mobjValid_NoBrokenRules()
RaiseEvent Valid(True)
End Sub
Public Sub Load()
If mflgEditing Then Err.Raise 445 If Not mflgNew Then Err.Raise 445 ' code to load the object goes here
mflgNew = False
End Sub
Public Sub Delete()
If Not mflgEditing Then Err.Raise 445 mflgDeleted = True
End Sub
Public Property Get IsDeleted() As Boolean
IsDeleted = mflgDeleted
End Property
Public Property Get IsNew() As Boolean
IsNew = mflgNew
End Property
Public Property Get IsDirty() As Boolean
IsDirty = mflgDirty
End Property
Chapter 12/VideoObjectsMTS/Customer.clsVERSION 1.0 CLASSBEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObjectENDAttribute VB_Name = "Customer"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = TrueAttribute VB_PredeclaredId = FalseAttribute VB_Exposed = TrueOption Explicit
Event Valid(IsValid As Boolean)
Private mudtProps As CustomerPropsPrivate mudtSave As CustomerProps
Private mflgNew As BooleanPrivate mflgDeleted As BooleanPrivate mflgDirty As BooleanPrivate mflgEditing As BooleanPrivate WithEvents mobjValid As BrokenRulesAttribute mobjValid.VB_VarHelpID = -1
Public Sub BeginEdit()
If mflgEditing Then Err.Raise 445 ' save object state LSet mudtSave = mudtProps mflgEditing = True
End Sub
Public Sub CancelEdit()
If Not mflgEditing Then Err.Raise 445 mflgEditing = False mflgDeleted = False mflgDirty = False ' restore object state LSet mudtProps = mudtSave End Sub
Public Sub ApplyEdit()
Dim objPersist As CustomerPersist If Not mflgEditing Then Err.Raise 445
Set objPersist = CreateObject("VideoServerMTS.CustomerPersist", PERSIST_SERVER) If mflgDeleted And Not mflgNew Then ' code to delete the object's data goes here objPersist.DeleteObject mudtProps.CustomerID mflgNew = True mflgDeleted = False
ElseIf mflgDirty Or mflgNew Then If Not IsValid Then Err.Raise 445 ' save object to database if appropriate SetState objPersist.Save(GetState) ' save object state LSet mudtSave = mudtProps mflgNew = False
End If
Set objPersist = Nothing mflgDirty = False mflgEditing = False
End Sub
Private Sub Class_Initialize()
mflgNew = True Set mobjValid = New BrokenRules ' if we know any rules are broken on startup ' then add code here to initialize the list ' of broken rules ' ' mobjValid.RuleBroken "RuleName", True mobjValid.RuleBroken "Name", True mobjValid.RuleBroken "Phone", True
End Sub
Public Property Get IsValid() As Boolean
IsValid = (mobjValid.Count = 0)
End Property
Private Sub mobjValid_BrokenRule()
RaiseEvent Valid(False)
End Sub
Private Sub mobjValid_NoBrokenRules()
RaiseEvent Valid(True)
End Sub
Public Sub Load(CustomerID As Long)
Dim objPersist As CustomerPersist If mflgEditing Then Err.Raise 445 If Not mflgNew Then Err.Raise 445 Set objPersist = CreateObject("VideoServerMTS.CustomerPersist", PERSIST_SERVER) SetState objPersist.Fetch(CustomerID) Set objPersist = Nothing
mobjValid.RuleBroken "Name", False mobjValid.RuleBroken "Phone", False mflgNew = False
End Sub
Public Sub Delete()
If Not mflgEditing Then Err.Raise 445 mflgDeleted = True mflgDirty = True End Sub
Public Property Get IsDeleted() As Boolean
IsDeleted = mflgDeleted
End Property
Public Property Get IsNew() As Boolean
IsNew = mflgNew
End Property
Public Property Get IsDirty() As Boolean
IsDirty = mflgDirty Or mflgNew
End Property
Public Property Get CustomerID() As Long
CustomerID = mudtProps.CustomerID
End Property
Public Property Let Name(Value As String)
If Not mflgEditing Then Err.Raise 383 If Len(Value) > Len(mudtProps.Name) Then _ Err.Raise vbObjectError + 1001, "String value too long" mobjValid.RuleBroken "Name", (Len(Trim$(Value)) = 0)
mudtProps.Name = Value mflgDirty = True
End Property
Public Property Get Name() As String
Name = Trim$(mudtProps.Name)
End Property
Public Property Let Address1(Value As String)
If Not mflgEditing Then Err.Raise 383 If Len(Value) > Len(mudtProps.Address1) Then _ Err.Raise vbObjectError + 1001, "String value too long"
mudtProps.Address1 = Value mflgDirty = True
End Property
Public Property Get Address1() As String
Address1 = Trim$(mudtProps.Address1)
End Property
Public Property Let Address2(Value As String)
If Not mflgEditing Then Err.Raise 383 If Len(Value) > Len(mudtProps.Address2) Then _ Err.Raise vbObjectError + 1001, "String value too long" mudtProps.Address2 = Value mflgDirty = True
End Property
Public Property Get Address2() As String
Address2 = Trim$(mudtProps.Address2)
End Property
Public Property Let City(Value As String)
If Not mflgEditing Then Err.Raise 383 If Len(Value) > Len(mudtProps.City) Then _ Err.Raise vbObjectError + 1001, "String value too long" mudtProps.City = Value mflgDirty = True
End Property
Public Property Get City() As String
City = Trim$(mudtProps.City)
End Property
Public Property Let State(Value As String)
If Not mflgEditing Then Err.Raise 383 If Len(Value) > Len(mudtProps.State) Then _ Err.Raise vbObjectError + 1001, "String value too long" mudtProps.State = UCase$(Value) mflgDirty = True
End Property
Public Property Get State() As String
State = Trim$(mudtProps.State)
End Property
Public Property Let ZipCode(Value As String)
Dim intDash As Integer
If Not mflgEditing Then Err.Raise 383 If Len(Value) > Len(mudtProps.ZipCode) Then _ Err.Raise vbObjectError + 1001, "String value too long" intDash = InStr(1, Value, "-")
If intDash > 0 Then mudtProps.ZipCode = _