$OpenBSD: patch-sqlquery_c,v 1.3 2003/06/03 01:26:50 margarida Exp $ --- sqlquery.c.orig Mon Dec 3 18:08:30 2001 +++ sqlquery.c Tue Jun 3 02:10:04 2003 @@ -22,7 +22,6 @@ #include "util.h" #include "constants.h" #include "sqldumplogins.h" -#include void usage(char **argv) { @@ -63,11 +62,18 @@ TDSLOGIN *set_target_defaults(TDSLOGIN * void doInterpret(TDSLOGIN *pLogin, char *pQuery) { TDSSOCKET *pTds = NULL; + TDSCONTEXT *context = NULL; + TDSCONNECTINFO *connect_info; char *pCmd; pCmd = (char *) malloc ( 256 ); /* connect to the SQL server */ - if( (pTds = tds_connect(pLogin)) !=NULL ) { + context = tds_alloc_context(); + pTds = tds_alloc_socket(context, 512); + tds_set_parent(pTds, NULL); + connect_info = tds_read_config_info(NULL, pLogin, context->locale); + + if (!connect_info || tds_connect(pTds, connect_info) != TDS_FAIL) { fprintf(stderr, "SQLExec %s by \n", SQLTOOLS_VERSION); fprintf(stderr, "----------------------------------------------------" \