home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / dbmsg / oledb / tablecopy / tablecopy.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-12  |  2.5 KB  |  95 lines

  1. //-----------------------------------------------------------------------------
  2. // Microsoft OLE DB TABLECOPY Sample
  3. // Copyright (C) 1995-1998 Microsoft Corporation
  4. //
  5. // @doc
  6. //
  7. // @module TABLECOPY.H
  8. //
  9. //-----------------------------------------------------------------------------
  10.  
  11. #ifndef _TABLECOPY_H_
  12. #define _TABLECOPY_H_
  13.  
  14.  
  15. ///////////////////////////////////////////////////////////////
  16. // Includes
  17. //
  18. ///////////////////////////////////////////////////////////////
  19. #include "oledb.h"
  20.  
  21.  
  22. ///////////////////////////////////////////////////////////////
  23. // Forward Declarations
  24. //
  25. ///////////////////////////////////////////////////////////////
  26. class CTable;
  27. class CWizard;
  28.  
  29.  
  30. ///////////////////////////////////////////////////////////////
  31. // Defines
  32. //
  33. ///////////////////////////////////////////////////////////////
  34. #define MAX_QUERY_LEN            4096
  35. #define MAX_NAME_LEN            256
  36.  
  37. #define MAX_COL_SIZE           50000
  38. #define MAX_BLOCK_SIZE              20
  39. #define MAX_STREAM_BLOCK_SIZE    2000
  40.  
  41. // Create param bitmasks describe the parameter required on create table
  42. #define CP_PRECISION        0x0001
  43. #define CP_SCALE            0x0002
  44. #define CP_LENGTH            0x0004
  45. #define CP_MAXLENGTH        0x0008
  46.  
  47. // This macro will determine if the type is numeric, and 
  48. // if numeric -> bPrecision, if not numeric -> dwColumnSize
  49. #define COLINFO_SIZE(ColInfo) (IsNumericType(ColInfo.wType) ? ColInfo.bPrecision : ColInfo.ulColumnSize)
  50.  
  51.  
  52. /////////////////////////////////////////////////////////////////
  53. // CTableCopy
  54. //
  55. /////////////////////////////////////////////////////////////////
  56. class CTableCopy
  57. {
  58. public:
  59.     //Constructors
  60.     CTableCopy(CWizard* pCWizard);
  61.     virtual ~CTableCopy();
  62.     
  63.     //Members
  64.     virtual HRESULT MapTypes();
  65.     virtual HRESULT CopyTables();
  66.  
  67.     //Row Options
  68.     DWORD        m_dwRowOpt;            // Row Options
  69.     ULONG        m_ulMaxRows;        // Maximum rows or ALL_ROWS
  70.     
  71.     //Insert Options
  72.     DWORD        m_dwInsertOpt;        // Insert Options
  73.     ULONG        m_ulParamSets;        // Number of Parameters Sets
  74.     
  75.     //BLOB options
  76.     DWORD        m_dwBlobOpt;        // Blob Options
  77.     ULONG        m_ulBlobSize;       // Maximum Size for BLOB Columns
  78.  
  79.     //Options
  80.     BOOL        m_fShowQuery;        // TRUE to display SQL statements
  81.     BOOL        m_fCopyTables;        // TRUE to create the table definition
  82.     BOOL        m_fCopyIndexes;        // TRUE to create indexes on new table
  83.     BOOL        m_fCopyPrimaryKeys;    // TRUE to copy primary keys on new table
  84.  
  85.     //Data
  86.     CTable*        m_pCFromTable;        //Source Table
  87.     CTable*        m_pCToTable;        //Target Table
  88.  
  89.     BOOL        m_fTranslate;        // TRUE to translate object names
  90.     CWizard*    m_pCWizard;
  91. };
  92.  
  93.  
  94. #endif    //_TABLECOPY_H_
  95.