Share this Page URL
Help

Part: I Client/Server Development > Building Unbound Applications - Pg. 416

416 Chapter 13. Building Unbound Applications IN THIS CHAPTER · · · · · Why This Chapter Is Important The Benefits of Unbound Applications The Unbound Form The Unbound Form and Pass-Through Queries The Unbound Form and Stored Procedures Why This Chapter Is Important Sometimes Access introduces unnecessary overhead into an application. When this occurs, you might decide to control everything yourself. An unbound form uses no linked tables. With an unbound form, you must do everything yourself. You must write the code to connect to the database, populate the form with data, and save any changes to disk. The process generally involves a combination of ActiveX data object (ADO) code, pass-through queries, and SQL Server stored procedures. The text that follows covers specific techniques involved. The Benefits of Unbound Applications The goal of an unbound application is to bring back as little data as possible over the network wire and to connect to the database for as short a period as possible. With an unbound application, you can control exactly what happens to your SQL Server database and when. Unbound applications are more scalable than bound applications, meaning that you can deploy them to much larger groups of users. Furthermore, it is easy to move unbound applications to a three-tier architecture, as dis- cussed in Chapter 14, "Building N-Tier Applications." The Unbound Form The form used in the first example utilizes a public ADO connection object. This object initializes when the form loads and remains in memory as long as the application is running. You will need to evaluate whether it is more efficient to re-establish the connection repeatedly or to maintain the public connection. Generally, if there are fewer users, the approach shown in this example (a public connection) is more efficient. This is because Access does not need to connect to the server re- peatedly. As the number of users increases, you may find that the public connection utilizes exces- sive server resources. You would then modify the code to have each event routine establish its own local connection. The code in Listing 13.1 uses the Open method of the Connection object to establish a connection to the NorthWind database on the 5000Alison server. Notice that the code supplies the user ID and password. As an alternative, you could use integrated security to establish the connection.