This commit is contained in:
foobar 2003-05-31 02:30:50 +00:00
parent 32a0044a21
commit 935672787a

View File

@ -2088,7 +2088,7 @@ int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int
* #ifdef HAVE_EMPRESS */
{
int direct = 0;
char dsnbuf[300];
char dsnbuf[1024];
short dsnbuflen;
char *ldb = 0;
int ldb_len = 0;
@ -2105,13 +2105,16 @@ int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int
}
}
if (direct)
rc = SQLDriverConnect((*conn)->hdbc, NULL, ldb, strlen(ldb), dsnbuf, 300,
if (direct) {
rc = SQLDriverConnect((*conn)->hdbc, NULL, ldb, strlen(ldb), dsnbuf, sizeof(dsnbuf),
&dsnbuflen, SQL_DRIVER_NOPROMPT);
else
} else {
rc = SQLConnect((*conn)->hdbc, db, SQL_NTS, uid, SQL_NTS, pwd, SQL_NTS);
if (ldb)
}
if (ldb) {
efree(ldb);
}
}
#else
rc = SQLConnect((*conn)->hdbc, db, SQL_NTS, uid, SQL_NTS, pwd, SQL_NTS);