* Unregister specified DSN. * * @param dsn DSN name. * @return True on success and false on fail. */
| 89 | * @return True on success and false on fail. |
| 90 | */ |
| 91 | bool UnregisterDsn(const std::wstring& dsn) { |
| 92 | #ifdef __linux__ |
| 93 | auto dsn_vec = ODBC::ToSqlWCharVector(dsn); |
| 94 | const SQLWCHAR* dsn_arr = dsn_vec.data(); |
| 95 | #else |
| 96 | // Windows and macOS |
| 97 | const SQLWCHAR* dsn_arr = dsn.c_str(); |
| 98 | #endif |
| 99 | if (SQLRemoveDSNFromIni(dsn_arr)) { |
| 100 | return true; |
| 101 | } |
| 102 | |
| 103 | PostLastInstallerError(); |
| 104 | return false; |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * Register DSN with specified configuration. |