⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 olemr.cpp

📁 从vc连接到oracle数据库。包括连接
💻 CPP
字号:
/**************************************************************************
@author  Chandar
@version 1.0
Development Environment        :  Visual C++ 6.0
Name of the File               :  OLEMR.cpp
Creation/Modification History  :
                                  07-Aug-2001     Created

Sample Overview
---------------

This sample shows how to set the custom command properties 'PLSQLRSet' and
'NDatatype' with the command object using Oracle Provider for OLEDB.
The sample uses OLEDB interfaces to communicate to database

  PLSQLRSet property

  When multiple records are to be fetched from the database using stored
  procedure , Ref cursor variable is used as out parameter to the 
  stored procedure. 

  The Ref Cursor variables are bound automatically by the provider in the 
  application and they are not required to be passed to stored procedure
  while calling it through the application.
  
  In order to tell the provider that a ref cursor variable is being used
  'ORAPROP_PLSQLRSet' property is to be set to true. This can be done at the 
  connection  time or through the command object just before calling the stored
  procedure.
  
  The performance is better if it is set using command object because the 
  extra network trip to database is performed only for the execution of that 
  command.

  This sample uses a stored procedure with ref cursor variable argument to 
  get the data for product information in two categories i.e. Orderable and 
  Under Development.

NDatatype property

  When NLS data is to be passed as the parameter to SQL statement or stored
  procedure, the property 'ORAPROP_NDatatype' is to be set to true.

  This property can be set through the command interface object.
  
  This sample asks the user to select a product and a language in which to 
  enter the name and description of product.
  When a product and a language is selected, the existing name and description 
  of product is retrieved from database and displayed in text boxes.
  The user can update the product details. If data does not exists in 
  database, it is inserted else it is updated.
  **************************************************************************/

#include "stdafx.h"
#include "OleMR.h"
#include "OleMRDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// COleMRApp

BEGIN_MESSAGE_MAP(COleMRApp, CWinApp)
	//{{AFX_MSG_MAP(COleMRApp)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG
	ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// COleMRApp construction

COleMRApp::COleMRApp()
{
	// TODO: add construction code here,
	// Place all significant initialization in InitInstance
}

/////////////////////////////////////////////////////////////////////////////
// The one and only COleMRApp object

COleMRApp theApp;

/////////////////////////////////////////////////////////////////////////////
// COleMRApp initialization

BOOL COleMRApp::InitInstance()
{
	AfxEnableControlContainer();

	// Standard initialization
	// If you are not using these features and wish to reduce the size
	//  of your final executable, you should remove from the following
	//  the specific initialization routines you do not need.

#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif

	COleMRDlg dlg;
	m_pMainWnd = &dlg;
	int nResponse = dlg.DoModal();
	if (nResponse == IDOK)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with OK
	}
	else if (nResponse == IDCANCEL)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with Cancel
	}

	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump.
	return FALSE;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -