?
Solved

Import an access Object using VB code

Posted on 2003-02-25
3
Medium Priority
?
242 Views
Last Modified: 2013-12-25
  I am trying to import an object using VB code.
   For instance, I have several DB's that all use the same Module. Currently when I change the module I am forced to change it in each DB (10+ locations). I guess you could say, I am looking to centralize redundant code. Essencially, I would like to store any generic code in one Main DB. Then any changes could easily be made to one specific location, without having to update 10+ different DB's.
   Is there a way to use VB code to import specific objects (module,form,table) from one DB to another? I would appreciate any Ideas. Thanks in advance...
0
Comment
Question by:Rochedog35
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 3

Accepted Solution

by:
QJohnson earned 400 total points
ID: 8019911
Not a great idea for purists, but pretty efficient in my opinion.

When you add an object to your vb apps, you have a dialog offering you New or Existing.  Just choose existing and point it at the folder that has your 'master' copy of the module in question.  

If you keep it under source safe control, you can just add it to a project as a shared file, of course.  

The purists would say that you should consider packaging the module in a ActiveX DLL project if the code is fairly stable.  Then you can reference it when ever you want in other projects and never have to wonder whether you have accidentally changed its source (since you can't).  There is some merit in this thinking if the module is REALLY stable.  But it's pretty easy to get bitten by compatibility issues after changes are made.  So look at this issue carefully before leaping.

QJ
0
 
LVL 2

Assisted Solution

by:i014354
i014354 earned 400 total points
ID: 8026415
You can use the DoCmd.TransferDatabase with the appropriate parameters to import the modules, forms, tables, etc. from other databases.
0
 
LVL 1

Expert Comment

by:ayufans
ID: 9221710
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points split between QJohnson and i014354

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

ayufans
Cleanup Volunteer
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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
Course of the Month13 days, 13 hours left to enroll

801 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