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

Chapter 31. Distributing Your Applicatio... > Verifying Server Connection in a Pro...

Verifying Server Connection in a Project File

As you can imagine, it’s equally important to verify the connection to the SQL Server database in an Access project file (.adp). In some ways, checking the connection is much simpler than checking linked tables in an Access desktop database. If the project’s IsConnected property is True, then the project thinks it has a good connection to some database. However, you should also verify that the connected database is the one required by the project.

When the project’s IsConnected property is False, you have some more work to do. If you expect the project file to run with a local copy of SQL Server, the code must first attempt to start the server and connect to it. If the project uses an SQL Server running on another machine, the code must attempt to connect to that server. After establishing a connection, the code can query the master database to find out if the required database is on the server.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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