[AccessD] Set references via automation

jwcolby jwcolby at colbyconsulting.com
Tue Jan 3 07:25:55 CST 2012


Shamil,

 > But did you try to use RefLibPaths to solve your library databases referencing issues without 
custom Automation programming.

First of all, I am already copying libraries and the application and then opening the application. 
I was doing it from batch files, which have a huge disadvantage of not knowing which batch file, 
where it is located, what is inside of it etc.  Systems change, paths change, files required change. 
  Certainly not often but often enough to make it an ongoing problem.

So I decided to move from a batch file solution to a table driven programmatic solution.  I *love* 
the resulting system, I can just look in tables to see what is being copied, where it is coming 
from, where it is going to etc.

I originally did the whole thing in SQL Server / Access / VBA.  SQL Server holds the data, Access 
does the data entry forms (and eventually a report) and VBA does the automation, moving the files 
from production to the workstation and opening the application FE.  It kinda mostly worked but 
occasionally the FE would open hidden and couldn't be closed without task manager.

So I switched to C# to do the copy / open part.  That is rock solid, the application always opens 
visible etc.

So I now have an entire system in place to do this stuff.  Setting the references to be exactly what 
I expect is just a tiny additional piece.  When all is said and done, RefLibPaths simply says 
"here's where to search when the references are broken".  What it doesn't do is *force* a reference 
to a specific location.  My system will *force* the reference to precisely the location that I just 
copied the file, in essence to ensure that when I copy the lib to the workstation path, the 
reference *will* point to that path, ALWAYS.


John W. Colby
Colby Consulting

Reality is what refuses to go away
when you do not believe in it

On 1/2/2012 1:53 PM, Salakhetdinov Shamil wrote:
> Hi John --
>
>> You don't think this can be done from the C# code as well?
> Yes, you can use C# to Automate MS Access instance to open a program database and to set references etc.
> The issue could be how to block Autoexec macro or start-up form from running...
>
> But did you try to use RefLibPaths
>
> http://support.microsoft.com/kb/824255
>
> to solve your library databases referencing issues without custom Automation programming
>
> ?
>
> Thank you.
>
> -- Shamil



More information about the AccessD mailing list