Refresh ODBC Connection to SQL Server

bconner

Registered User.
Local time
Today, 12:19
Joined
Dec 22, 2008
Messages
183
I have a Database I created on Sql Server and I have created a User Login: FinancialAnalytics with Password: Finance.

I want to be able to link Access to this Database and distribute to 10 or 15 people. I want everyone to use the same Login and Password mentioned above to access the data. Below is code I thought I could use but setting the parameter Trusted_Connection=No that it would prompt the user for a Login and password but it didn't work. If I refresh from my desk windows pops up a SQL Server Login Box but when one of the other 10 people tries it it doesn't work.





Code:
Function RefreshTableLinks() As Boolean
Dim tbl     As TableDef
       
    'Refresh the ODBC links to the SQL Server tables.
    On Error GoTo err_RefreshTableLinks
    CurrentDb.QueryTimeout = 60
    Screen.MousePointer = 10
    For Each tbl In CurrentDb.TableDefs
        
        'Ignore local tables.
        If tbl.Connect <> "" Then
           tbl.Connect = "ODBC;DRIVER=SQL Server Native Client 10.0;SERVER=addwddtls7b1\billinganalytic2;Trusted_Connection=No;Database=Finance_Analytics;"
            
            tbl.RefreshLink
        End If
    Next
    RefreshTableLinks = True
    Screen.MousePointer = 0
  
    
    Exit Function
    
err_RefreshTableLinks:
    RefreshTableLinks = False
    Screen.MousePointer = 0
    
End Function
 

Users who are viewing this thread

Back
Top Bottom