• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 29. Programming Combo and List B... > In the Real World—Access Combo and L...

In the Real World—Access Combo and List Boxes

Access’s bound combo and list boxes offer many advantages over corresponding native controls available to Visual Basic programmers. Automatic multi-field capability in both combo and list boxes, and semi-formatted columns in Access list boxes are just two of the advantages of the Access version. When you migrate to ADP, another advantage of Access combo and list boxes becomes evident. As the frmDrillDown and frmDrillDownAll forms of the sample VBACombo.adp file demonstrate, you can populate combo and list boxes from Transact-SQL statements sent to the server as an alternative to creating SQL Server views.

The downside of sending SQL statements to SQL Server is that performance suffers because SQL Server optimizes and compiles the query before execution. Sending long SQL statements to a remote server also contributes to list-box latency. Compare the time required to first populate the Line Items list box using a connection to MSDE’s NorthwindCS database on your PC to that for Jet’s Northwind; Jet is significantly faster. (The performance difference is accentuated on a slower PC or one having 256MB or less RAM.) After you run the query once, however, the performance difference is minimal because SQL Server stores the compiled version in memory. When you re-execute the query, SQL Server 2000 checks to see whether it’s in memory; if so, it executes the copy without recompilation. If you alter WHERE clause criteria, SQL Server must recompile the query on each execution.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint