How do I get ms-access to connect to ms-sql as a different user?

前端 未结 6 1325
没有蜡笔的小新
没有蜡笔的小新 2021-01-06 20:04

How do I get ms-access to connect (through ODBC) to an ms-sql database as a different user than their Active Directory ID?

I don\'t want to specify an account in th

6条回答
  •  有刺的猬
    2021-01-06 20:47

    We admit here that you are using an ODBC connexion to your database with Integrated Security on, so that you do not have/do not want to write a username/pasword value in the connexion string (which is according to me the right choice).

    In this case, there is fortunately no way to "simulate" another user when connecting to the data. Admit with me that being able to make such a thing would be a huge break in integrated security!

    I understood from your previous post that you wanted users to be able to update the data or not depending on the client interface they use. According to me, the idea would be to create for each table a linked 'not updatable' view. Let's say that for each table called Table_Blablabla you create a view (=query in Access) called View_Table_Blablabla ...).

    When using Access, you can then decide at runtime wether you want to open the updatable table or the read-only view. This can be done for example at runtime, in the form_Open event, by setting the form recordsource either to the table or the view.

提交回复
热议问题