LISTING 4: Modifying and Executing a Pass-Through Query Dim db As DAO.Database Dim qdf As DAO.QueryDef Set db = CurrentDb Set qdf = db.QueryDefs("TestPassthrough") qdf.Connect = " ODBC;Driver={SQL Server};" _ & "Server=(local);Database=Products;Trusted_Connection=Yes" qdf.SQL = "IF (select USER_NAME()) <> 'ProductApprole' " _ & "EXEC sp_setapprole 'ProductApprole', 'password' " _ & "EXEC procSupplierList" qdf.ReturnsRecords = True qdf.Execute