From d12409f05b1e9b19fda1251a6ecc264e1d267edb Mon Sep 17 00:00:00 2001 From: Tomaz Zupan Date: Tue, 5 Feb 2002 20:24:20 +0000 Subject: [PATCH] 2002-02-05 21:22 UTC+0100 Tomaz Zupan --- harbour/ChangeLog | 5 +++++ harbour/contrib/odbc/Makefile | 7 +++---- harbour/contrib/odbc/odbc.c | 15 +++++++++++++-- harbour/contrib/odbc/todbc.prg | 4 ++++ 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 7ab33758f9..cc62ff2c4c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -7,6 +7,11 @@ For example: 2002-12-01 23:12 UTC+0100 Foo Bar */ +2002-02-08 22:45 UTC+0300 Alexander Kresin + * source/vm/runner.c + * Bug fixed, which caused GPF in case of using a call of undefined function + * include/hbextern.ch + * added definitions of new __hrb... functions for providing possibility to call them from .hrb . 2002-02-07 20:48 UTC+0300 Alexander Kresin diff --git a/harbour/contrib/odbc/Makefile b/harbour/contrib/odbc/Makefile index 12e6f03057..09f8a4eb69 100644 --- a/harbour/contrib/odbc/Makefile +++ b/harbour/contrib/odbc/Makefile @@ -8,9 +8,8 @@ C_SOURCES=\ odbc.c \ PRG_SOURCES=\ + todbc.prg\ -PRG_MAIN=testodbc.prg +LIBNAME=hbodbc -LIBS=\ - -include $(TOP)$(ROOT)config/bin.cf +include $(TOP)$(ROOT)config/lib.cf diff --git a/harbour/contrib/odbc/odbc.c b/harbour/contrib/odbc/odbc.c index ef352dc6ac..cb92f837b6 100644 --- a/harbour/contrib/odbc/odbc.c +++ b/harbour/contrib/odbc/odbc.c @@ -64,7 +64,10 @@ * */ -#include +#if defined(HB_OS_WIN_32) + #include +#endif + #include #include #include @@ -99,10 +102,18 @@ HB_FUNC( SQLDRIVERC ) /* HB_SQLDRIVERCONNECT( hDbc, @ cConnectString, lPrompt ) { BYTE bBuffer1[ 1024 ]; SWORD wLen; - RETCODE ret = SQLDriverConnect( ( HDBC ) hb_parnl( 1 ), + #if defined(HB_OS_WIN_32) + RETCODE ret = SQLDriverConnect( ( HDBC ) hb_parnl( 1 ), GetDesktopWindow(), hb_parc( 2 ), strlen(hb_parc(2)), bBuffer1, 1024, &wLen, SQL_DRIVER_COMPLETE ) ; + #elif defined(HB_OS_UNIX) + RETCODE ret = SQLDriverConnect( ( HDBC ) hb_parnl( 1 ), + 0, + hb_parc( 2 ), strlen(hb_parc(2)), + bBuffer1, 1024, &wLen, SQL_DRIVER_COMPLETE ) ; + + #endif hb_storc( bBuffer1 , 3 ); hb_retni( ret ); } diff --git a/harbour/contrib/odbc/todbc.prg b/harbour/contrib/odbc/todbc.prg index 79d56b73b4..f8acddfe93 100644 --- a/harbour/contrib/odbc/todbc.prg +++ b/harbour/contrib/odbc/todbc.prg @@ -149,6 +149,7 @@ RETURN( "Error " + cErrorClass + " - " + cErrorMsg ) METHOD New( cODBCStr ) CLASS TODBC LOCAL xBuf + LOCAL nRet // WHILE .t. ::cODBCStr := cODBCStr @@ -278,6 +279,9 @@ RETURN ( ( nRet == 0 ) ) // Only executes the SQL Statement METHOD ExecSQL() CLASS TODBC + LOCAL lRet + LOCAL xBuf + LOCAL nRet WHILE .T.