Relink Tables

  • Thread starter Thread starter scott
  • Start date Start date
S

scott

is it possible with code to test the connection to sql and return some type
of prompt to choose the correct sql server or atleast prevent access from
trying to connect to a non-existant sql connection?
 
No really, because the code for connecting to SQL-Server will execute before
any other VBA code. Your best bet would be to close the connection and set
it to null at the end of a session; however with ADP, your users shouldn't
have to reconnect to a new server on a regular basis. Search this newsgroup
on Google for CloseConnection for more info on that:

http://groups.google.ca/group/micro...r/search?q=closeconnection&start=0&scoring=d&

If you want to, you can easily test a connection to a SQL-Server in VBA code
using ADO objects.
 
you could use SqlDmo in order to test for whether a server is a sql
server before you allow the real connection

also Northwind.ADP or NorthWindCS.ADP has a couple of really nice
examples of opening and closing connections; i would reccomend poking
through that code.
 
ÎÒÒªÕÒ»ï°é£¬Ë­ºÍÎÒÒ»ÆðÀ´Ñ½¡£×öÉúÒ⣬ÓÐûÓÐÈËÄØ£¿
 
Back
Top