Reset connection properties for all pass thru queries ?/?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • harshakusam
    New Member
    • Apr 2009
    • 36

    Reset connection properties for all pass thru queries ?/?

    Hi All,

    Can some pls tell me the syntax that to placed in below _____

    When i set ODBC connect strg properties by query properties it something looks like....

    Code:
     
    
    ODBC;DRIVER={Oracle ODBC Driver for Rdb};SERVER=XXX.COM@FXDB@11111@W;UID=hars;PWD=password;SVR=XXX.COM;CLS=FXDB;
    DATABASE=ATTACH 'FILENAME ABC_DB';XPT=2;CSO=1;DBA=W;DSO=0;TLL=;TLO=0;
    Code:
     Public Const strConnect= "[B]________[/B]"
    
    Function SetConnections()
    On Error GoTo Trapper
    
    
    For Each QueryDef In CurrentDb.QueryDefs
    If QueryDef.Connect <> "" Then
    QueryDef.Connect = "ODBC;" & strConnect
    End If
    Next
  • harshakusam
    New Member
    • Apr 2009
    • 36

    #2
    Hi All,

    I Got IT ......
    Code:
    Public Const strConnect = "Set your connection string here"
    
    Function SetConnections()
    
    MsgBox strConnect
    
    For Each QueryDef In CurrentDb.QueryDefs
    If QueryDef.Connect <> "" Then
    QueryDef.Connect = "ODBC;" & strConnect
    End If
    Next
    
    End Function
    Thanksss

    Comment

    Working...