Creating a Global Connection Object to SQL

J

James

Hi:

I am reading a book about Access project with SQL server.

When I create a project, it will ask you link to the server step by step,
which I link the server successfully. But also the book introduces:"Creating
a Global Connection Object Using VBA code", which I also made it works.

My question is: If I can create a Global Connection Object, I don't need
enter the information when I create a project at the very beginning, is that
correct?

Thanks a lot.

James
 
M

Michel Walsh

You are using Access itself, not VB6, not Dot-Net? Then, even if I am not
totally aware of the context, I would say the answer is no. In fact, there
will be few use I can see in doing it, since Access will store, in the adp
file, the connection, and will open it for you, as soon as you open the
application. You can reach that connection, through VBA, asking for

CurrentProject.Connection


Creating a second independent connection just add management burden to you,
and to the SQL Server. It is preferable to share the one that Access would
have created for you, imho, unless you are in a situation I cannot imagine,
at this moment.


Vanderghast, Access MVP
 
Top