Information générale
Catégorie:
Codage, syntaxe et commandes
>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.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement