Attaching External Access Table to Access Database 
Author Message
 Attaching External Access Table to Access Database



>I'm having problems attaching an external access table to another
>access database.

>Here is the code.

>Sub attachTable ()

>Dim newTable as New TableDef
>Dim myDb as Database

>set myDb = OpenDatabase ("c:\db\wquality.mdb", FALSE, FALSE)

>newTable.Name = "wsys"
>newTable.Connect = "c:\db\landbase.mdb"
>newTable.SourceTableName = "water_system"

>myDb.TableDefs.Append newTable

>Exit Sub

>Upon executing the last line, I get an "Unable to find Installable ISAM"
>error. I know this error occurs when you have an invalid setting
>in the connect property for a data control but the documentation
>states that for a new TableDef object, this property should be set
>to the path of the database containing the table ( set in the
>SourceTableName property).

>Also, when I do this, will this keep the attachment permanent? Meaning,
>if I open the .mdb under Access, will I see the attachment created
>under VB? If not, how can keep the attachment permanent.

>If attaching a table at run time is not possible (The doc says that
>it is), I have one question for those of you who have delivered VB
>applications to customers with attached tables. Do you force the
>directory of the mdb files onto the user? (Not a good idea in my
>opinion) If not, how do you modify the attachments so the directories
>match? Let me give you an example:

>    On my computer
>    Database A
>            c:\db\keith.mdb
>    Table a_table1
>            located in keith.mdb
>    Table b_table1
>            attached from Database B

>    Database B

This problem usually occurs becaus you don't have the Installable ISAMS
section specified in your INI file.  The standard VB.INI has them in it but VB
want to find them in a file <PROGRAM>.INI.

To overcome this you can add them to your programs INI file or add the
following code to your program.

           Set DataAccessOption 1 "VB.INI"

Hope this helps..

Jeff Sinason

Tue, 05 May 1998 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Attaching Access Table in external database

2. Attaching Access table in external database

3. How can I attach External MS-Access Tables to MS-AccessDatabases

4. Attaching tables to external Sybase database.

5. Dynamicaly Attach Access table between database

6. attaching an ODBC table to access database

7. Attached Tables in a multi-user ACCESS Database

8. Updating SQL60 database from a attached ACCESS table

9. How to attach tables to a readonly Access 2.0 database using VB

10. Access database with attached foxpro tables

11. Help: attaching Btrieve table in Access 2.0 database using VB 4.0 16-bit

12. Refer to Table External Access Database


Powered by phpBB® Forum Software