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

Chapter 13. Building Unbound Application... > The Unbound Form and Pass-Through Qu...

The Unbound Form and Pass-Through Queries

The examples in the previous section all use ADO code and SQL statements to retrieve and update table data. An alternative is to use a stored pass-through query to accomplish the same results. Pass-through queries provide an efficient means of retrieving and updating SQL Server data. Pass-through queries require two pieces of information: They require the SQL statement that you want to execute and connection information for how to connect to the SQL Server.

Using a Pass-Through Query to Populate the Form with Data

The examples that follow use the frmCustomersPassThrough form located in the Chap13Ex database. To run the examples, you must have an ODBC datasource called NorthWind that points at the SQL Server NorthWind database. As with the previous examples, because the form is unbound, it is necessary that you write the code to populate the controls on the form with data from the underlying database. Listing 13.9 shows the code under the Retrieve command button. As you can see in Listing 13.9, this code is the same code that we used when we opened a recordset to retrieve the data.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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