M
M
Mercury132017-03-28 18:08:52
Database
Mercury13, 2017-03-28 18:08:52

Unusual ODBC + SQLDriverConnect drivers: what are your glitches?

Task: Interactively build an ODBC connection string. Because of the extremely confusing standard driver selection dialog, I choose the driver myself and then run SQLDriverConnect with a non-empty string.

retcode = SQLDriverConnect( // SQL_NULL_HDBC
                hdbc,
                reinterpret_cast<HWND>(aWinId),
                const_cast<wchar_t*>(drv.data()),   // "DRIVER={Driver name}"
                drv.length(),
                OutConnStr,
                4096,
                &OutConnStrLen,
                SQL_DRIVER_COMPLETE );

As always, there are drivers from which you want to take and hang yourself. I have two bugs so far.
1. If the driver did not return anything and it turned out through PostMessage that it did not reach the interactive dialog, output: "The driver is not able to interactively build a connection string."
2. If we are sitting in SQLDriverConnect and at the same time doing something in the driver selection dialog, display "The driver "Driver name" is running, switch to it via Alt + Tab and close the dialog."
The first met in MYOB and partially in MySQL 3.x - the first has no interactive dialog at all, the second returns an error on Cancel. The second is in MySQL 3.x.
Moreover, support for SQLDriverConnect refers to the Core level, i.e. must be supported by the driver unconditionally.
What else to do with these strange drivers?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question