SQLAllocEnv(&henv);
SQLAllocConnect(henv, &hdbc);
rc = SQLConnect(hdbc, server, SQL_NTS, uid, SQL_NTS, pwd, SQL_NTS);
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
print_err(henv, hdbc, SQL_NULL_HSTMT);
exit(0);
}
SQLAllocStmt(hdbc, &hstmt);