Page 17 - Microsoft Office Excel 2003 Programming Inside Out
P. 17
Table of Contents
The Command Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
Key Properties and Methods of the Command Object . . . . . . . . . . . 488
Using the Parameters Collection . . . . . . . . . . . . . . . . . . . . . . . . . . 489
Using the Parameter Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
The Recordset Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
Key Properties and Methods of the Recordset Object . . . . . . . . . . . 491
Using the Fields Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
Using the Field Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
Chapter 24
Excel Query Program 497
Excel Query Program Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
Setting Up the Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
Initializing the Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
Ending the Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
Connecting to a Database. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
Initializing the DBInfo UserForm . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
Changing Database Providers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
Selecting Windows Authentication . . . . . . . . . . . . . . . . . . . . . . . . . 504
Saving the Database Info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
Editing a Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
Executing a Database Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
Getting the Information to Run the Query . . . . . . . . . . . . . . . . . . . . 508
Building a Connection String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
Getting the Query. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
Running a Query. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
Copying Rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
Using the Excel Query Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
Configure the Connection Information . . . . . . . . . . . . . . . . . . . . . . 516
Enter a Query. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
Run the Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
Chapter 25
Excel and the Web 519
HTML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
Saving a Worksheet as a Web Page . . . . . . . . . . . . . . . . . . . . . . . . 520
Publishing a Worksheet to the Web . . . . . . . . . . . . . . . . . . . . . . . . 523
Making Web-Based Worksheets Interactive. . . . . . . . . . . . . . . . . . . 525
Using the Internet as a Data Source . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
Opening Web Pages as Workbooks . . . . . . . . . . . . . . . . . . . . . . . . 528
Using Web Queries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529
Parsing Web Pages for Specific Information . . . . . . . . . . . . . . . . . . 532
Using the Internet to Publish Results. . . . . . . . . . . . . . . . . . . . . . . . . . . 533
Setting Up a Web Server. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533
Saving Worksheets as Web Pages . . . . . . . . . . . . . . . . . . . . . . . . . 534
xvii