Results 1 to 8 of 8
  1. #1
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568

    Urgent - problem with permissions to ms sql server

    Hi,



    i set up ms sql server as BE and Access as FE

    I am connecting to MS SQL Server using Tab External Data and ODBC Database.

    NExt i am creating computer data source : SQLServerProd:

    Click image for larger version. 

Name:	login.png 
Views:	15 
Size:	45.2 KB 
ID:	32443

    And it is working fine.

    Problem is that it is working only on my computer. Anywehere else users can not log into MS SQL Server Database:

    Click image for larger version. 

Name:	problem.png 
Views:	15 
Size:	18.6 KB 
ID:	32444
    This code throws an error:

    Code:
    Set rs = CurrentDb.OpenRecordset("tbl_Login_Emp", dbOpenSnapshot, dbReadOnly)
    So it is problem with connecting into MS SQL Server.

    So i need to create data source connection automatically for every user using FE.
    Users do not have my private computer connection "SQLServerProd" so this is the error.

    How can i fix it?

    Best,
    Jacek

  2. #2
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    Problem is how to make my ODBC connection available to all users?

    Jacek

  3. #3
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    I am trying to use this code:

    Code:
    Sub Start()
    
    
    
    
        Dim db As DAO.Database
        Dim tdf As DAO.TableDef
        Dim StringConnect As String
        
    StringConnect = "Provider=SQLOLEDB;Data Source=NT-WRO1-PLAT01\SQLEX2014;Initial Catalog=Sody;User ID=sod;Password=Sod#2018"
        
        Set db = CurrentDb
        
        For Each tdf In db.TableDefs
            ' Only make a change if the table is a linked table
            If Len(tdf.Connect) Then
                tdf.Connect = StringConnect
                tdf.RefreshLink
            End If
        Next
    End Sub
    But all the time windows forces me to choose DSN data source...:

    Click image for larger version. 

Name:	problem2.png 
Views:	14 
Size:	39.8 KB 
ID:	32445

    Please help,
    Jacek

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Don't know much about this! Isn't there a way to store the connection information when you link the table, a checkbox allowing you to save it? There is also a way to set the ODBC connection in VBA, which you could use in the database open routine.

  5. #5
    Gicu's Avatar
    Gicu is offline VIP
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,235
    Hi Jacek,
    How did you setup your MS SQL server, specifically what authentication type have are you using. It seems like you want to go with SQL authentication (basically sharing one SQL user's credentials among all your users). It might be better to give read/write permissions to a group and make all your intended users part of that group. That way you can use auditing tools in SQL server to monitor individual's actions. Here is a link explaining the differences: https://stackoverflow.com/questions/...ows-authentica

    You may also need to relink your tables making sure you check the Save Password check box. Here is a link showing you hot to do it in code https://access-programmers.co.uk/for...d.php?t=285814 . You'll need to modify the code to add a loop through all the CurrrentDb.Tabledefs (checking for the .connect string if contains "SQL" to identify the SQL tables).

    Cheers,
    Vlad

  6. #6
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    Thank you very much my Friends!

    I learned a lot reading your posts and links and tryint to solve problem.
    Problem was connected with wrong driver when connecting FE to BE.

    Driver instead of MS SQL Server Native 11.0 should be SQL Server (basic one).
    This solve the problem connection for users on Access Runtimes.

    Thank you very much !
    Jacek

  7. #7
    Join Date
    Apr 2017
    Posts
    1,775
    You export the Windows registry key for ODBC connection in your computer to file;
    Every user must have local administration rights when installing ODBC Connection, and must have a copy of registry editor file you created on some local folder in computer (p.e. on Desktop);
    The user starts the registry editor file, and responds YES when asked. When finished, the ODBC connection is created, and the user can delete the registry editor file from computer.
    In case users will access database from terminal server, an administrator has to install the connection to TS.

    Users start their front-end, and when user rights are set properly for SQL Server database, all must work.

  8. #8
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    In case users will access database from terminal server, an administrator has to install the connection to TS.
    Administrator has to create connection from his local computer to terminal server, and this connection should be installed on every user computer?

    It is not necessary my friend. I created one ODBC connection on my local computer with SQL Server driver to BE MS SQL Server on terminal server and all users can also access to BE tables from Access Runtime FE.

    Jacek

Please reply to this thread with any new information or opinions.

Similar Threads

  1. SQL Server Permissions
    By RayMilhon in forum SQL Server
    Replies: 2
    Last Post: 11-21-2017, 10:40 AM
  2. SQL Server function needs permissions
    By EuniceH in forum SQL Server
    Replies: 2
    Last Post: 07-03-2014, 10:43 AM
  3. Replies: 1
    Last Post: 05-17-2012, 05:51 PM
  4. Need Urgent Help [Related Connect DB to Server]
    By gunapriyan in forum Access
    Replies: 0
    Last Post: 08-18-2010, 09:49 AM
  5. Access 2007 Users and Permissions Problem
    By botts121 in forum Security
    Replies: 3
    Last Post: 07-06-2009, 10:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums