From: Piotr Caban <piotr@codeweavers.com> --- dlls/msado15/recordset.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c index c760cbabbd2..aec94e08032 100644 --- a/dlls/msado15/recordset.c +++ b/dlls/msado15/recordset.c @@ -1866,6 +1866,8 @@ static HRESULT WINAPI recordset_putref_ActiveConnection( _Recordset *iface, IDis static HRESULT WINAPI recordset_put_ActiveConnection( _Recordset *iface, VARIANT connection ) { struct recordset *recordset = impl_from_Recordset( iface ); + ADOConnectionConstruction15 *construct; + IUnknown *session; _Connection *conn; LONG state; HRESULT hr; @@ -1893,6 +1895,19 @@ static HRESULT WINAPI recordset_put_ActiveConnection( _Recordset *iface, VARIANT hr = _Connection_get_State( conn, &state ); if (SUCCEEDED(hr) && state != adStateOpen) hr = MAKE_ADO_HRESULT( adErrInvalidConnection ); + if (SUCCEEDED(hr)) + hr = _Connection_QueryInterface(conn, &IID_ADOConnectionConstruction15, (void**)&construct); + if (SUCCEEDED(hr)) + { + hr = ADOConnectionConstruction15_get_Session(construct, &session); + ADOConnectionConstruction15_Release(construct); + } + if (SUCCEEDED(hr)) + { + if (!session) hr = MAKE_ADO_HRESULT( adErrInvalidConnection ); + else IUnknown_Release(session); + } + if (FAILED(hr)) { _Connection_Release( conn ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9895