Files
harbour-core/harbour/contrib/hbodbc/tests/testodbc.prg
Viktor Szakats 74c14c6fa8 2009-03-27 01:52 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* utils/hbmk2/hbmk2.prg
  * contrib/hbole/tests/hbole.hbp
  * contrib/gtwvg/tests/gtwvg.hbp
  * contrib/hbwin/tests/hbwin.hbp
  - utils/hbmk2/examples/winapi.hbp
    + Added all important Windows system libs to all
      win compilers in hbmk2.
    - Removed above libs from .hbp files.

  * contrib/hbodbc/todbc.prg
  * contrib/hbodbc/browodbc.prg
  * contrib/hbodbc/odbc.c
    * Further cleanups.
      SETNUMLEN() -> SQLNUMSETLEN(). This should probably be a core
      function by the name HB_NUMSETLEN().

  * contrib/hbole/tests/testole.prg
  * contrib/hbole/tests/sample.odt
    + Updated to latest hbole code.
    ; TOFIX: hbole code doesn't compile with MSVC in default C++
             even if #define CINTERFACE 1 is enabled.
    ; TOFIX: OpenOffice example fails at some point. It probably
             needs array support.

  * contrib/hbole/olecore.c
    * Minor formatting.

  * contrib/hbqt/hbqt_qabstractitemview.cpp
    ! Fixed backslash to forward slash.

  * contrib/hbct/tests/ctwtest.prg
  * contrib/hbnf/dispmsg.prg
  * contrib/hbnf/pegs.prg
  * contrib/hbnf/tbwhile.prg
  * contrib/hbnf/calendar.prg
  * contrib/gtwvg/tests/demowvg.prg
  * contrib/examples/terminal/trm_server.prg
  * contrib/examples/terminal/trm_client.prg
    ! Using manifest constants.

  * contrib/hbmysql/mysql.c
  * contrib/hbodbc/odbc.c
    * Minor cleanup.

  * contrib/hbodbc/tests/odbcdemo.prg
  * contrib/hbodbc/tests/odbccall.prg
  * contrib/hbodbc/tests/testodbc.prg
    * Minor.
2009-03-27 00:55:52 +00:00

58 lines
1.4 KiB
Plaintext

/*
* $Id$
*/
#include "sql.ch"
#xcommand GET ROW <nRow> INTO <cVar> => ;
<cVar> := space( 128 ) ;;
SQLGetData( hStmt, <nRow>, SQL_CHAR, len( <cVar> ), @<cVar> )
PROCEDURE Main()
LOCAL hEnv := 0
LOCAL hDbc := 0
LOCAL hStmt := 0
LOCAL cConstrin
LOCAL cConstrout := SPACE(1024)
LOCAL nRows := 0
LOCAL cCode, cFunc, cState, cComm
cConstrin := "DBQ=" + hb_FNameMerge( hb_DirBase(), "test.mdb" ) + ";Driver={Microsoft Access Driver (*.mdb)}"
? padc( "*** ODBC ACCESS TEST ***", 80 )
?
? "Allocating environment... "
SQLAllocEnv( @hEnv )
? "Allocating connection... "
SQLAllocConnect( hEnv, @hDbc )
? "Connecting to driver " + cConstrin + "... "
SQLDriverConnect( hDbc, cConstrin, @cConstrout )
? "Allocating statement... "
SQLAllocStmt( hDbc, @hStmt )
?
? "SQL: SELECT * FROM TEST"
SQLExecDirect( hStmt, "select * from test" )
?
DO WHILE SQLFetch( hStmt ) == 0
nRows++
GET ROW 1 INTO cCode
GET ROW 2 INTO cFunc
GET ROW 3 INTO cState
GET ROW 4 INTO cComm
? cCode, padr( cFunc, 20 ), cState, cComm
ENDDO
? "------------------------------------------------------------------------------"
? str( nRows, 4 ), " row(s) affected."
SQLFreeStmt( hStmt, SQL_DROP )
SQLDisConnect( hDbc )
SQLFreeConnect( hDbc )
SQLFreeEnv( hEnv )
RETURN