home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / dbmsg / odbc / admndemo / execute.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-10-08  |  3.7 KB  |  90 lines

  1. //*---------------------------------------------------------------------------------
  2. //|  ODBC System Administrator
  3. //|
  4. //|  This code is furnished on an as-is basis as part of the ODBC SDK and is
  5. //|  intended for example purposes only.
  6. //|
  7. //|   Title:   EXECUTE.H
  8. //|      This file contains the prototypes and defines for executing SQL
  9. //|         statements and displaying their results.
  10. //*---------------------------------------------------------------------------------
  11. #ifndef execute_DEFS
  12. #define execute_DEFS
  13.  
  14. #include <windows.h>
  15. #include "menu.h"
  16. #include "admndemo.h"
  17. #include "standard.h"
  18. #include "errcheck.h"
  19. #include "results.h"
  20. #include "ctl3d.h"
  21. #include "ini.h"
  22. #include "sql.h"
  23. #include "sqlext.h"
  24.  
  25. //*---------------------------------------------------------------------------------
  26. //|   Macros and Defines
  27. //*---------------------------------------------------------------------------------
  28. #define MINSTMTSIZE                           100
  29. #define MAXSTMTSIZE                          9999
  30. #define IDD_EXECUTE_FILE                     3100
  31. #define NO_STOP                              -999
  32. #define IDT_FILE                              500
  33. #define IDB_FILE                              501
  34. #define IDR_CARRIAGE                          502
  35. #define IDR_CHARACTER                         503
  36. #define IDE_CHARACTER                         504
  37. #define IDR_NOSTOP                            505
  38. #define IDR_SQLERROR                          506
  39. #define IDE_MAXLENGTH                         507
  40.  
  41. #define EXECUTE_DIRECT_SQL_STMT                 1
  42. #define PREPARE_SQL_STMT                        2
  43. #define EXECUTE_SQL_STMT                        3
  44.  
  45. typedef struct tagRESULTSINFO {
  46.    RESULTSSET FAR *     rs;               // Results set
  47.    CHILDINFO FAR *      ci;               // Child info
  48.    int                  xLeftCol;         // Left column index
  49.    int                  xRightCol;        // Right column index
  50.    int                  dx;               // Client screen width
  51.    int                  dy;               // Client screen height
  52.    RECT                 tRect;            // Client rectangle
  53.    BOOL                 fScrollPresent;   // TRUE if scroll bar is visible
  54.    struct tagRESULTSINFO FAR * next;
  55.    struct tagRESULTSINFO FAR * prev;
  56.    } RESULTSINFO, FAR * lpRESULTSINFO;
  57.  
  58. #define GETRWPOINTER(hwnd) (lpRESULTSINFO)(GetWindowLong(hwnd, 0))
  59. #define SETRWPOINTER(hwnd, x) SetWindowLong(hwnd, 0, (LONG)(x))
  60.  
  61.  
  62. //*---------------------------------------------------------------------------------
  63. //|   Global variables
  64. //*---------------------------------------------------------------------------------
  65. extern HMENU hMenu;
  66.  
  67. extern dCSEG(char) szResultsClass[];
  68. extern dCSEG(char) szDash[];
  69.  
  70.  
  71. //*---------------------------------------------------------------------------------
  72. //|   Function prototypes
  73. //*---------------------------------------------------------------------------------
  74. void ExecuteFile(CHILDINFO FAR * ci, HWND hwnd, LPSTR szExeFile,
  75.       LPSTR szTerm, int cbStmt);
  76. void DoCommitRollback(CHILDINFO FAR * ci, int type);
  77. void ExecuteCmds(CHILDINFO FAR * ci, LPSTR stmt);
  78. void CheckForResults(CHILDINFO FAR * ci);
  79. void FreeConnectWindowResults(CHILDINFO FAR * ci);
  80. lpRESULTSSET GetConnectWindowResultsNode(lpCHILDINFO lpci);
  81. BOOL INTFUN CreateResultsWindow(CHILDINFO FAR * ci, lpRESULTSSET rs);
  82. long FAR PASCAL ResultsWndProc(HWND hwnd, unsigned msg, WPARAM wParam, LPARAM lParam);
  83. BOOL SetMetaDataFromSql(HWND hwndOut, HSTMT hstmt, RESULTSSET FAR * rs, int cbCols);
  84. SDWORD FetchAllRecordsToResults(HWND hwndOut, HSTMT hstmt,
  85.             RESULTSSET FAR * rs, int cbCols, BOOL fFetch);
  86. SDWORD PrintAffectedRows(HSTMT hstmt, HWND hwnd);
  87.  
  88.  
  89. #endif
  90.