diff --git a/src/connector/odbc/src/install.sh b/src/connector/odbc/src/install.sh index 6f45ce43573324511bfc6f729dd64ada5cb0918d..02f31de70ed76e150fbef5d388cbd8a3e9ba73b3 100755 --- a/src/connector/odbc/src/install.sh +++ b/src/connector/odbc/src/install.sh @@ -9,14 +9,15 @@ rm -f "${BLD_DIR}/template.dsn" cat > "${BLD_DIR}/template.ini" < "${BLD_DIR}/template.dsn" <taos = taos_connect(ip, userName, auth, NULL, port); + conn->taos = taos_connect(ip, uid, pwd, NULL, (uint16_t)port); if (!conn->taos) { - SET_ERROR(conn, "08001", terrno, "failed to connect to data source"); + SET_ERROR(conn, "08001", terrno, "failed to connect to data source for DSN[%s] @[%s:%d]", dsn, ip, port); break; } } while (0); - tsdb_conv_free(client_to_server, serverName, &buffer, (const char*)ServerName); - tsdb_conv_free(client_to_server, userName, &buffer, (const char*)UserName); - tsdb_conv_free(client_to_server, auth, &buffer, (const char*)Authentication); + tsdb_conv_free(client_to_server, dsn, &buffer, (const char*)ServerName); + tsdb_conv_free(client_to_server, uid, &buffer, (const char*)UserName); + tsdb_conv_free(client_to_server, pwd, &buffer, (const char*)Authentication); + tsdb_conv_free(client_to_server, svr, &buffer, (const char*)server); return conn->taos ? SQL_SUCCESS : SQL_ERROR; } @@ -2877,6 +2875,8 @@ SQLRETURN SQL_API SQLSetStmtAttr(SQLHSTMT StatementHandle, return r; } +#ifdef _MSC_VER + #define LOG(fmt, ...) \ do { \ FILE *fout = fopen("C:\\test\\test.log", "ab+"); \ @@ -3125,6 +3125,7 @@ BOOL INSTAPI ConfigDriver(HWND hwndParent, WORD fRequest, LPCSTR lpszDriver, LPC return FALSE; } +#endif // _MSC_VER static void init_routine(void) {