home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 32 / IOPROG_32.ISO / SOFT / SqlEval7 / devtools / samples / ODBC / loaddata / loaddata.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-20  |  2.7 KB  |  81 lines

  1. // LoadData.cpp : Defines the class behaviors for the application.
  2. //
  3. // This file is part of Microsoft SQL Server online documentation.
  4. // Copyright (C) 1992-1997 Microsoft Corporation. All rights reserved.
  5. //
  6. // This source code is an intended supplement to the Microsoft SQL
  7. // Server online references and related electronic documentation.
  8. #include "stdafx.h"
  9. #include "LoadData.h"
  10. #include "LDDlg.h"
  11.  
  12. #ifdef _DEBUG
  13. #define new DEBUG_NEW
  14. #undef THIS_FILE
  15. static char THIS_FILE[] = __FILE__;
  16. #endif
  17.  
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CLoadDataApp
  20. /////////////////////////////////////////////////////////////////////////////
  21. BEGIN_MESSAGE_MAP(CLoadDataApp, CWinApp)
  22.     //{{AFX_MSG_MAP(CLoadDataApp)
  23.         // NOTE - the ClassWizard will add and remove mapping macros here.
  24.         //    DO NOT EDIT what you see in these blocks of generated code!
  25.     //}}AFX_MSG
  26.  
  27. //  No help file...comment this out
  28. //    ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  29. END_MESSAGE_MAP()
  30.  
  31. /////////////////////////////////////////////////////////////////////////////
  32. // CLoadDataApp construction
  33. /////////////////////////////////////////////////////////////////////////////
  34. CLoadDataApp::CLoadDataApp()
  35.     {
  36.     // TODO: add construction code here,
  37.     // Place all significant initialization in InitInstance
  38.     }
  39.  
  40. /////////////////////////////////////////////////////////////////////////////
  41. // The one and only CLoadDataApp object
  42. /////////////////////////////////////////////////////////////////////////////
  43. CLoadDataApp theApp;
  44.  
  45. /////////////////////////////////////////////////////////////////////////////
  46. // CLoadDataApp initialization
  47. /////////////////////////////////////////////////////////////////////////////
  48. BOOL CLoadDataApp::InitInstance()
  49.     {
  50.     // Standard initialization
  51.     // If you are not using these features and wish to reduce the size
  52.     //  of your final executable, you should remove from the following
  53.     //  the specific initialization routines you do not need.
  54.  
  55. #ifdef _AFXDLL
  56.     Enable3dControls();            // Call this when using MFC in a shared DLL
  57. #else
  58.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  59. #endif
  60.     CLoadDataDlg dlg;
  61.     m_pMainWnd = &dlg;
  62.  
  63.     if (SQLAllocHandle(SQL_HANDLE_ENV, NULL, &(dlg.m_henv)) != SQL_SUCCESS)
  64.         {
  65.         return (FALSE);
  66.         }
  67.  
  68.     SQLSetEnvAttr(dlg.m_henv, SQL_ATTR_ODBC_VERSION, (void*) SQL_OV_ODBC3,
  69.         SQL_IS_INTEGER);
  70.     
  71.     // Display the dialog
  72.     dlg.DoModal();
  73.  
  74.     // Clean up
  75.     SQLFreeHandle(SQL_HANDLE_ENV, dlg.m_henv);
  76.  
  77.     // Since the dialog has been closed, return FALSE so that we exit the
  78.     //  application, rather than start the application's message pump.
  79.     return FALSE;
  80.     }
  81.