Thanks, I now use this for connecting to development, test andproduction

D

Dirk Horsten

Private Sub connectMyself(dbVers As versProj)

Dim def As TableDef
Dim bmrcConnect As String, bmrcTbl, accessLink As String
Select Case dbVers
Case versRecette
bmrcConnect = "ODBC;DSN=TO DEV;SERVER=DEVSERVER"
Case versQualif
bmrcConnect = "ODBC;DSN=TO TEST;SERVER=QUALSERVER;"
Case versProd
bmrcConnect = "ODBC;DSN=TO PROD;SERVER=PRODSERVER"
Case versUnknown
bmrcConnect = ""
End
End Select
For Each def In CurrentProject.Application.CurrentDb.TableDefs
accessLink = def.Name
' Only the ODBC_* tables are linked
If Left(accessLink, 5) = "ODBC_" Then
def.Connect = bmrcConnect
def.RefreshLink
End If
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top