2012-02-13 4 views
2
Dim Cnxn As ADODB.Connection 
Set Cnxn = New ADODB.Connection 
With Cnxn 
    .Provider = "MSDataShape" 
    .Properties("Data Provider").Value = "SQLOLEDB" 
    .Properties("Data Source").Value = dbserver 
    .Properties("User ID").Value = Username 
    .Properties("Password").Value = password 
    .Properties("Initial Catalog").Value = dbname 
    .CommandTimeout = 120 
    .ConnectionTimeout = 120 
    .Open 
End With 

위의 내용은 MS Access에서 사용자 이름이 기본 SQL 사용자 이름 인 SQL Server에 연결하는 방법입니다. 그러나 Windows 사용자 이름으로 연결하고 싶지만 각 Windows 사용자마다 하나씩 SQL Server에 100 개의 사용자 이름을 만들 시간이 없습니다. 이 일을하는 좋은 방법이 있습니까? 이것은 감사 목적을위한 것이므로 누가 무엇을했는지 알 수 있습니다.MS Access with Windows with SQL Server의 사용자 이름

답변

3

Properties UserIDPassword을 제거하고 Integrated Security의 값을 true으로 바꿉니다.

.Properties("Integrated Security").Value = true 

*

true

+0

에 대한 자본 T 수 있는지 DB 서버가 로그인에 대해 알고 또는 더 나은 아직 그룹 사용자의 오전 구성원 만들 수 있습니다. –