Removed superfluous second setting of SQL_ATTR_ACCESS_MODE in connect() #98
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Removed the call to SQLSetConnectAttr that set SQL_ATTR_ACCESS_MODE every time connect() was called. Kept the call that sets SQL_ATTR_ACCESS_MODE only when the user specifies a read-only connection. My rationale for this choice is (1) that it is better practice not to explicitly set attributes that equate to default behaviour, because it plays better for our user if a (poorly designed) ODBC driver has not implemented the attribute, and (2) that this is how I believe pyodbc behaves with 'readonly'.
I think the same arguments would lead to only setting SQL_ATTR_AUTOCOMMIT if autocommit is false, but I don't have the nerve to make that change as well, or to search for other similar cases!