Importing Ms Access Table with its relationship at runtime through code

Posted on 2005-05-03
Medium Priority
Last Modified: 2013-12-25
Thanks for replying,
At the outset I don't want to create new relationship / field.

Since The relationships are already defined in Database1, I just want to import the Tables along with the relationships from Database1 to Database2.

As mentioned before, i am able to import the table to Database2 but not its relationship.

Further, when I tried to execute the following code, it gave me the error as stated below.
    Set f = rel.CreateField("DeptID", dbInteger)     [error : Type mismatch]
    f.ForeignName = "DeptID"                              [method or data member not found]

I am using the following Reference in my project :
a) Microsoft ActiveXData Object 2.5 Library
b) Micorsof DAO 3.6 Object Library
c) Microsoft Access 9.0 Object Library  

Question by:s_monani
1 Comment
LVL 12

Accepted Solution

Preece earned 2000 total points
ID: 13939796

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question