-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ODBC from MS-Accesss gives error ((-7701) and (-7702)) #39
Comments
Same problem for me |
I can add here that Excel / External Data / ODBC does not stop with error-messages, but fails to present a list of tables to choose from. So there is not much one can do with the DSN nor with making a connection to a file. |
Same issues:
|
The ODBC client used in MS Access (also known as Microsoft Jet) has specific requirements to the `SQLGetInfo` driver function. First, it requires `SQL_ODBC_API_CONFORMANCE` to be supported. Second, it requires the output parameter `StringLengthPtr` to be set by driver even when the `InfoValuePtr` is set to non-character (integer) value. Otherwise it fails with `Reserved error (-7701);` message and disconnects immediately after the successfull connection. This change adds a new helper `StoreWithLength` and applies it to all non-character usages in `SQLGetInfo` and in `SQLGetConnectAttr` functions. With it MS Access can establish the connection and start running SQL queries. Though, it still fails on schema introspectio (more Jet-specific fixes are needed in driver), so duckdb#39 remains open for now. Testing: length check for non-character data is added to the existing test.
The ODBC client used in MS Access (also known as Microsoft Jet) has specific requirements to the `SQLGetInfo` driver function. First, it requires `SQL_ODBC_API_CONFORMANCE` to be supported. Second, it requires the output parameter `StringLengthPtr` to be set by driver even when the `InfoValuePtr` is set to non-character (integer) value. Otherwise it fails with `Reserved error (-7701);` message and disconnects immediately after the successfull connection. This change adds a new helper `StoreWithLength` and applies it to all non-character usages in `SQLGetInfo` and in `SQLGetConnectAttr` functions. With it MS Access can establish the connection and start running SQL queries. Though, it still fails on schema introspectio (more Jet-specific fixes are needed in driver), so duckdb#39 remains open for now. Testing: length check for non-character data is added to the existing test.
With the fix proposed in #63 it allows the Access to get from this error: a little bit further. It still fails when trying to do the schema introspection: More fixes are needed for Access (Microsoft Jet engine) specific problems, but such fixes can be largely lifted from the Postgres ODBC driver, that includes the detection and specific branching logic for Jet - link. |
The ODBC client used in MS Access (also known as Microsoft Jet) has specific requirements to the `SQLGetInfo` driver function. First, it requires `SQL_ODBC_API_CONFORMANCE` to be supported. Second, it requires the output parameter `StringLengthPtr` to be set by driver even when the `InfoValuePtr` is set to non-character (integer) value. Otherwise it fails with `Reserved error (-7701);` message and disconnects immediately after the successfull connection. This change adds a new helper `StoreWithLength` and applies it to all non-character usages in `SQLGetInfo` and in `SQLGetConnectAttr` functions. With it MS Access can establish the connection and start running SQL queries. Though, it still fails on schema introspectio (more Jet-specific fixes are needed in driver), so duckdb#39 remains open for now. Testing: length check for non-character data is added to the existing test.
I use odbc connections to sqlite (work flawlessly) and would like to add connections to duckdb.
Has anybody got the connections working flawlessly.
On trying to connect as an external table I get "Reserved error (-7701); there is no message for this error." and if I create a DSN I get "Reserved error (-7702); there is no message for this error."
I have tried installing the latest MS-C-re-distributable and under "language settings " ticking the utf-8 experimental setting. I have also changed system settings for region and language to English-US to minimize the risks.
but with all settings test-odbc gives the same results.
test_odbc
[6/31] (19%): Test SQLConnect and SQLDriverConnect
test_connection_odbc.exe is a Catch v2.13.7 host application.
Run with -? for options
Test SQLConnect with Ini File
D:\a\duckdb-odbc\duckdb-odbc\test\tests\connect_with_ini.cpp(9)
...............................................................................
D:\a\duckdb-odbc\duckdb-odbc\test\common.cpp(27): FAILED:
REQUIRE( (((ret)&(~1))==0) )
with expansion:
false
[1/1] (100%): Test SQLConnect with Ini File
test cases: 1 | 1 failed
assertions: 6 | 5 passed | 1 failed
The text was updated successfully, but these errors were encountered: