Mike Gunderloy
Pyramid Computers
90 Fifth Ave. #4
Brooklyn, NY 11217
718-398-4626
FAX 718-230-5539
CIS 72271,275
Internet ffmike@pipeline.com

Using Attachment Initializer
============================

Changes for Release 2:
1) Added a splash screen, which can be easily suppressed
2) Fixed a documentation bug (wrong names were given for the attach and detach functions)
3) Added ODBC attachment management
Changes for Release 3:
1) Changed names and generally cleaned up code
Changes for Release 4/1:
1) Changed name to avoid conflict with Microsoft Attachment Manager Add-In
2) Converted to Access 2.0
3) Converted to L/R Naming Conventions
4) Added remaining file types
Changes for Release 5/2:
1) Added more error handling
2) Added appropriate information to allow Add-In manager to manage this file

Initial installation:
1) Copy attini.mda to your Access directory
2) Start Access 2.0 and load any database
3) Select File|Add-Ins|Add-In Manager
4) Select ATTINI from the list and click Install, then Close
5) Exit and restart Access

c:\access\attmgr.mda=ro

For each database:
1) Import the two tables, zstblAttachedTable and zstblAttiniParameters, from 
attini.mda or sample.mdb
2) Open zstblAttiniParameters and enter the full path and file name of your 
attachment INI file (which you will create in a moment). Set Splash to "No" 
if you don't want to see the nifty splash screen.
3) Open zstblAttachedTable and enter the table names you would like your 
attached table to have after attachment. Make sure the "Attached" field 
is set to No. You do not need to fill in any other field at this time.
4) Create the ini file you specified in the zstblAttiniParameters table 
(step 2). It has the following format:

[Tables]
Name1_DB=c:\test\test.mdb
Name1_TY=Access
Name1_RF=Name There
Name2_DB=c:\test\test.mdb
Name2_TY=Access
Name2_RF=Other Name There
...

	Name1, Name2, and so on are the table names you entered in 
	tblAttachedTable in step 3. Each table has three entries in 
	the INI file, with _DB, _TY and _RF appended.
	
	The _DB entry contains the database name to import from. For 
	an Access table, this is the full path and file name of the .MDB 
	file. For a Btrieve file, this is the full path and file name 
	of the file.ddf file. For a dBase, Foxpro or Paradox file, this 
	is the full path, with trailing backslash, of the directory where 
	the file is. For an ODBC table, this is the full connect string -- 
	the easiest way to get this is to manually attach the table once 
	and copy it from the property sheet. An example for an attached 
	SQL Server table might be:

Checks_DB=ODBC;DSN=Financial_Server;UID=Mike;SP=Budgeting;WSID=Mike;
Database=Bank
	
	The _TY entry contains the type of file to attach. Valid choices 
	are Access, SQL (for ODBC attachments), Btrieve, dBase III, 
	dBase IV, Foxpro 2.0, Foxpro 2.5, Paradox 3 and Paradox 4.

	The _RF entry contains the name of the table in its native file. 
	For Access, ODBC or Btrieve files this is the table name. For 
	dBase, Foxpro and Paradox files this is the file name including
	extension.

Using the Functions
1) To attach tables based on the information in your INI file, run the 
mag_AttachTables() function. The mcrAttach macro in sample.mdb 
demonstrates this.
2) To detach tables (so that you can reattach them based on information 
in a different version of the INI file), run the mag_DetachTables() 
function. The Detach macro in sample.mdb demonstrates this.
