Everything you need to know about backup and disaster recovery with AWS, for FREE!
'Set desired connection status and corresponding ODBC Connect string glb_strLinkStatus = "TEST" Call SetConnectionString 'Loop through untill all tables are done Do Until rs.EOF = True Set tdf = dbs.TableDefs(rs!Table_name) tdf.Connect = glb_strConnect tdf.RefreshLink rs.MoveNext Loop
Public Function SetConnectionString() 'setup the glb_strConnect string to be the desired connection string; If server location changes, update it here Select Case glb_strLinkStatus Case "UNLINKED" glb_strConnect = "" Case "LIVE" glb_strConnect = "ODBC;Description=PSF live database connection;DRIVER=SQL Server;" & _ "SERVER=MO631-6301QVV\SQLEXPRESS2014;Trusted_Connection=Yes;" & _ "APP=Microsoft® Windows® Operating System;Database=data" Case "TEST" glb_strConnect = "ODBC;Description=PSF test database connection; DRIVER=SQL Server;" & _ "SERVER=MO631-6301QVV\SQLEXPRESS2014;Trusted_Connection=Yes;" & _ "Microsoft® Windows® Operating System;Database=data_TEST" Case Else MsgBox "No Global Link status Found" Exit Function End Select End Function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.