The Jet4 driver doesn't handle the DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO property which is passed in SetProperties. On return that property is marked as DBPROPSTATUS_NOTSUPPORTED and returns DB_S_ERRORSOCCURRED.
In this case, we dont care that isn't not supported and should allow the DataSource to succeed.
From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
The Jet4 driver doesn't handle the DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO property which is passed in SetProperties. On return that property is marked as DBPROPSTATUS_NOTSUPPORTED and returns DB_S_ERRORSOCCURRED.
In this case, we dont care that isn't not supported and should allow the DataSource to succeed. --- dlls/oledb32/datainit.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
diff --git a/dlls/oledb32/datainit.c b/dlls/oledb32/datainit.c index 38ed5ce0e53..39569cb1d84 100644 --- a/dlls/oledb32/datainit.c +++ b/dlls/oledb32/datainit.c @@ -755,6 +755,26 @@ HRESULT get_data_source(IUnknown *outer, DWORD clsctx, LPCOLESTR initstring, REF }
hr = IDBProperties_SetProperties(dbprops, 1, propset); + if (hr == DB_S_ERRORSOCCURRED) + { + /* + * Not all drivers support all properties and can return a non-fatal error. + * In this case, just trace the failed property and return success + */ + if (TRACE_ON(oledb)) + { + int i; + + for(i=0; i < propset->cProperties; i++) + { + if(propset->rgProperties[i].dwStatus != DBPROPSTATUS_OK) + WARN("Prop (%ld) status %ld\n", propset->rgProperties[i].dwPropertyID, + propset->rgProperties[i].dwStatus); + } + } + + hr = S_OK; + } IDBProperties_Release(dbprops); free_dbpropset(1, propset); if (FAILED(hr))
DB_S_ERRORSOCCURRED is a success return code. Is it possible we need != S_OK check instead then for this new trace, if we need it at all?
On Tue Jun 18 10:54:15 2024 +0000, Nikolay Sivov wrote:
DB_S_ERRORSOCCURRED is a success return code. Is it possible we need != S_OK check instead then for this new trace, if we need it at all?
Yes it is but then it's propagate back to to GetDataSource, which shouldn't return this value.
We don't need the trace and it can be removed. This was just an easy way to workout exactly what was wrong.
Would you happy with something like ``` /* Return S_OK for any success code. */ if(SUCCEEDED(hr)) hr = S_OK; ```