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

Chapter 21. Client/Server Strategies > Preconnecting to the Server

Preconnecting to the Server

When dealing with ODBC databases, connections to the server are handled transparently by Jet. After you issue a command, a connection is established with the server. When you finish an operation, Jet keeps the connection open in anticipation of the next operation. The ConnectionTimeout setting in the Windows Registry determines the amount of time the connection is cached. You might want to use the fact that a connection is cached to connect to the back-end when your application first loads, before the first form or report even opens. The connection and authentication information will be cached and used when needed.

As you saw in the LinkToSQL routine in Chapter 20, you can send password information stored in variables as parameters when creating a link to a server. These values easily could have come from a logon form. The code in Listing 21.1 pre-connects to the server. You generally would place this in the startup form for your application.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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