How To Link To A SQL Server Table With An AD Group - Not An Individual User

xiozqbni  于 2023-08-02  发布在  SQL Server
关注(0)|答案(1)|浏览(123)

I am using access VBA and DAO to programmatically create linked tables.

I build a string like this:

strConnect = "ODBC;DRIVER=SQL Server;Database=mydatabase;Server=myserver;

I then create the TableDef:

Set td = CurrentDb.CreateTableDef(stlocalTableName, dbAttachSavePWD, stRemoteTableName, strConnect)

I then append the TableDef:

CurrentDb.TableDefs.Append td

I want the tables created / linked under an AD Group instead of my user.

I have tried numerous options and all I ever see when I create the table is:

...;UID=myuser;Trusted_Connection=Yes;..

Is it possible to link a table using an AD Group instead of an Individual user?

P.S. The AD group has datareader and datawriter rights to the database.

x4shl7ld

x4shl7ld1#

It is the other way around. With a trusted connection, SQL reads the current logged on user and then looks up which rights might be granted to this user or the groups this user is a member of, and from this determines the final rights granted to the user. So try leaving out any SQL Server credentials, simply:

...;Trusted_Connection=Yes;..

相关问题