Dynamically Linked Tables

newtovba

New member
Local time
Today, 16:33
Joined
Mar 9, 2004
Messages
6
I am writing an application which requires a split database with forms, reports etc in an mde file. That mde links to tables on a server. So far, no problem. I want to be able to take the machine with the MDE off of the network and point to a local set of tables. Can this be done or do I need 2 MDE files?

Thanks
 
newtovba said:
I am writing an application which requires a split database with forms, reports etc in an mde file. That mde links to tables on a server. So far, no problem. I want to be able to take the machine with the MDE off of the network and point to a local set of tables. Can this be done or do I need 2 MDE files?

Thanks


You should be able to do this through the linked table manager
 
Parker said:
You should be able to do this through the linked table manager

I need to be able to do it 'On the fly'. For example, allow a user to select whether running remotely or locally. Depending on the answer, link to the correct tables.

Thanks
 
newtovba said:
I need to be able to do it 'On the fly'. For example, allow a user to select whether running remotely or locally. Depending on the answer, link to the correct tables.

Thanks

No problem You can prob do it in code.

If you placed a button group on your form you could place the code behind the buttons.

Take a look at this thread Here I think this is the sort of thing you need to do.
 
That's great thanks. However. How do I connect to one database or the other?

Cheers
 
newtovba said:
That's great thanks. However. How do I connect to one database or the other?

Cheers

Well theres lots of different ways you could do this through your GUI

You could do it automatically by having the code look for a default when you open the db. If the default isn't there then an IF routine will link to the alternative.

You could do it semi-automatic by placing one or more buttons on a form and have that form open as soon as you open the db.

You could have a button that opens up a list box so you can pick from a list.

you could activate an unbound text control and ask the user for the information. If you do this then you will need to pass this information as a string to your code.

And there are many others.

Personally, if possible, I would choose the first option. To do this you could use an auto-exec routine when the db first opens to fire your code. Your code would then need to deal with the links to both db's and read one as a default.An If routine would switch to the second choice if the default is not available.

I would then add an error routine that stops the process if something is wrong and ask the user for information.

This method would be ok if your db's are stattic. I.e. they never change location and the table structure dosn't change.

If your table structure changes then you will have problems for obvious reasons.

If the location changes then you will need to ask for a path every time you try to conect.
 

Users who are viewing this thread

Back
Top Bottom