Are you using and Access MDB or a an Access project (ADP)? Access projects
allow you to set it and forget it without having to use code at all which is
handy.
Otherwise I'm not sure that you can for mdb files. Maybe what you could do
as a work around is set up a global ADODB.connection variable and open it by
calling a functino in the autoexec macro. Then just reference the connection
variable when ever you want to make a call to the db. I've never done it so
I can't be certain but it should work I reckon.
Chuck this in a module and a RunCode action into an AutoExec macro with the
argument "SetConnection()" and see how you get on. The just use cnn when
ever you need to reference the connection. Have a crack.
-----------------------------------
Const CNNString = "Provider=Microsoft.Access.OLEDB.10.0;Persist Security
Info=True;Data Source=11.11.1.1\Fresh;User ID=SA;Password=PWord;Initial
Catalog=Fresh;Data Provider=SQLOLEDB.1"
Global cnn as ADODB.Connection
Function SetConnection()
Set cnn = New ADODB.Connection
cnn.ConnectionString= CNNString
cnn.Open
end function