Bytor
Bytor

Reputation: 33

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

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.

Upvotes: 1

Views: 117

Answers (1)

Gustav
Gustav

Reputation: 55961

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;..

Upvotes: 3

Related Questions