Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Linking Access Tables using VB
Message
From
01/06/2001 12:03:35
 
 
To
29/05/2001 15:03:19
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00512304
Message ID:
00513875
Views:
13
>I'm looking for a way to relink an access table using vb. I have it working in Access using the DoCmd.TransferDatabase. Does anyone have a way to do this?
>
>The reason I need to be able to do this is that I make modifications in an mdb that links to tables in either a Test database or the live database. I need a way to switch between them through VB code so that when a user logs on based on a registry entry it will relink to either the live data or production.
>
>Any help would be greatly appreciated.
>
>Nichole Brelje

>If the links exist already, you can change table links by using the tabledefs >collection:

>thisdb.TableDefs(0).Connect = "FoxPro 2.6;DATABASE=" & strNewConn
>thisdb.TableDefs(0).RefreshLink
>thisdb.TableDefs.Refresh
>Where thisdb refers to the opened MDB database and strNewConn has the path to >the new source.


I am attempting to use the connect as suggested but I am having a problem with the opendatabase.

How do I use OpenDatabase if the Database has a sytemdb.mdw with User and password?

Set db = OpenDatabase("c:\test.mdb", True, False, ??????)

I can open any databases that don't have a systemdb.mdw fine.

Thanks,

Nichole

PS: When you guys reply to the thread how come the previous message always shows up? When I reply I just get a blank message. Are you copying and pasting? It looks like when you reply to an email and the last message shows up. I know this is probably a really stupid question but I had to ask.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform