Relink Tables

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?
 
S

Sylvain Lafontaine

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.
 
A

aaron.kempf

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.
 
Y

yangxueliang

ÎÒÒªÕÒ»ï°é£¬Ë­ºÍÎÒÒ»ÆðÀ´Ñ½¡£×öÉúÒ⣬ÓÐûÓÐÈËÄØ£¿
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top