Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple instance of database

Status
Not open for further replies.

GKChesterton

Programmer
Aug 17, 2006
278
US
My database in Access 2003 lets a user examine items. I'd like the user to able to compare items side-by-side. I can design forms that allow this ... but why not just have the database open twice? Two instances of the database.

I know of three methods that could be viable:
[ol A][li]Open DB, then use Access Open dialog to open it again.[/li]
[li]Open using VBA Shell.[/li]
[li]Build a VBA class and open instances.[/li] [/ol]

I tried method B some time ago:
Code:
Private Sub buttonLaunchAnother_Click()
    Dim q As String:    q = """"
    Shell "MSAcc[s][/s]ess.exe " & q & "C:\MyDatab[s][/s]ase.mdb" & q, vbNormalFocus
End Sub
[tab]... but updates to recordsets would get assigned to the wrong item when switching between the two instances (I use the term loosely, I know it's not a class instance/instantiation) of the database. Variables would get crossed up.

At that time I learned method C is the elegant way to go. Now I think I am ready to attack it. However, revisiting methods A and B, I can't replicate the issue that made me abandon them before.

So my question is, are methods A and B really bad, and is C required? And any ideas how I could replicate the crossed-variable problem? And is there any other general advice?

[purple]If we knew what it was we were doing, it would not be called
[blue]research[/blue] database[white].[/white]development, would it? [tab]-- Albert Einstein[/purple]​
 
I wouldn't go with A, B or C.
If all the data is in the same database, a single connection will provide all the access you need.

What are the users comparing?

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
traingamer -- so I take you to mean, just build in the functionality using forms and reports.

The data consists of:
--Projects
--BOMs (multiple per project, as alternatives)
--Items within BOMs, 20+ fields to describe

User should be able to compare an item in project A with an item in project B. The two items have no shared datum or index, they are simply both of interest to the user. User should also should be able to compare an item in a project with any item in its 'template' version (items accue tweaks as they are used in BOMs, the template version shows all the default values).


[purple]If we knew what it was we were doing, it would not be called
[blue]research[/blue] database[white].[/white]development, would it? [tab]-- Albert Einstein[/purple]​
 
GKChesterton,
I have the same thoughts as traingamer, why not build a mechanism in the exisiting database that allows the user to open multiple instances of the various database objects (forms...) in a single instance of the running database?

CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
To clarify my last entry of 10:37, the functionality of item templates versus 'tweaked' BOM-specific records is all built and works fine, no questions there. I only mention that I would like that set of records, the item templates, available as well as BOM-specific items.

[purple]If we knew what it was we were doing, it would not be called
[blue]research[/blue] database[white].[/white]development, would it? [tab]-- Albert Einstein[/purple]​
 
Thanks CMP, I understand better now. I realize I implied method C meant a new connection to the database. Worse, I SAID that. I really meant a class instance of the form(s).

[purple]If we knew what it was we were doing, it would not be called
[blue]research[/blue] database[white].[/white]development, would it? [tab]-- Albert Einstein[/purple]​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top