• 大小: 3.85MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-12
  • 语言: C/C++
  • 标签: c++  数据库  

资源简介

c++链接Access数据库用二进制存储图像,并能显示图像等信息,很好的例子。

资源截图

代码片段和文件信息

// Example.cpp : Defines the class behaviors for the application.
//

#include “stdafx.h“
#include “Example.h“
#include “ExampleDlg.h“

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

/////////////////////////////////////////////////////////////////////////////
// CExampleApp

BEGIN_MESSAGE_MAP(CExampleApp CWinApp)
//{{AFX_MSG_MAP(CExampleApp)
// 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()

/////////////////////////////////////////////////////////////////////////////
// CExampleApp construction

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

/////////////////////////////////////////////////////////////////////////////
// The one and only CExampleApp object

CExampleApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CExampleApp initialization

BOOL CExampleApp::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.
AfxOleInit();
m_pConnection.CreateInstance(“ADODB.Connection“);
/******************连接数据库********************/
try
{
m_pConnection->ConnectionTimeout = 8;
//连接SQL SERVER
//m_pConnection->Open(“Driver=SQL Server;Database=test;Server=127.0.0.1;UID=sa;PWD=;“““““adModeUnknown);
//连接ACCESS2000
m_pConnection->Open(“Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Employee.mdb“““““adModeUnknown);
}
catch(_com_error e)///捕捉异常
{
AfxMessageBox(“数据库连接失败!“);
return FALSE;

/**********************************************/

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

CExampleDlg 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;
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件    4587520  2009-11-04 16:21  c++链接数据库用二进制存储图像,并能显示图像\Employee.mdb

     文件       1710  2009-11-05 11:52  c++链接数据库用二进制存储图像,并能显示图像\Example.clw

     文件       2656  2004-08-10 11:28  c++链接数据库用二进制存储图像,并能显示图像\Example.cpp

     文件       4177  2004-08-10 10:58  c++链接数据库用二进制存储图像,并能显示图像\Example.dsp

     文件        537  2004-08-10 10:58  c++链接数据库用二进制存储图像,并能显示图像\Example.dsw

     文件     443392  2009-11-05 11:52  c++链接数据库用二进制存储图像,并能显示图像\Example.ncb

     文件        248  2009-11-05 11:52  c++链接数据库用二进制存储图像,并能显示图像\Example.plg

     文件      14214  2004-08-12 08:54  c++链接数据库用二进制存储图像,并能显示图像\ExampleDlg.cpp

     文件       3597  2004-08-10 10:58  c++链接数据库用二进制存储图像,并能显示图像\ReadMe.txt

     文件       1145  2004-08-11 13:47  c++链接数据库用二进制存储图像,并能显示图像\resource.h

     文件        209  2004-08-10 10:58  c++链接数据库用二进制存储图像,并能显示图像\StdAfx.cpp

     文件       1152  2004-08-10 11:12  c++链接数据库用二进制存储图像,并能显示图像\StdAfx.h

     文件       1078  2004-08-10 10:58  c++链接数据库用二进制存储图像,并能显示图像\res\Example.ico

     文件        399  2004-08-10 10:58  c++链接数据库用二进制存储图像,并能显示图像\res\Example.rc2

    ..A.SH.      3072  2009-11-05 00:45  c++链接数据库用二进制存储图像,并能显示图像\res\Thumbs.db

     文件      90619  2008-04-14 20:00  c++链接数据库用二进制存储图像,并能显示图像\msado15.tlh

     文件      76614  2008-04-14 20:00  c++链接数据库用二进制存储图像,并能显示图像\msado15.tli

     文件      90811  2008-04-14 20:00  c++链接数据库用二进制存储图像,并能显示图像\Debug\msado15.tlh

     文件      76710  2008-04-14 20:00  c++链接数据库用二进制存储图像,并能显示图像\Debug\msado15.tli

     文件    1767251  2009-10-21 15:35  c++链接数据库用二进制存储图像,并能显示图像\Debug\StdAfx.sbr

     文件          0  2009-11-04 15:03  c++链接数据库用二进制存储图像,并能显示图像\Debug\Example.sbr

     文件          0  2009-11-04 15:03  c++链接数据库用二进制存储图像,并能显示图像\Debug\ExampleDlg.sbr

     文件    3179520  2009-11-04 15:03  c++链接数据库用二进制存储图像,并能显示图像\Debug\Example.bsc

     文件       3072  2009-11-05 11:50  c++链接数据库用二进制存储图像,并能显示图像\Debug\Example.res

     文件     238592  2009-11-05 11:52  c++链接数据库用二进制存储图像,并能显示图像\Debug\vc60.idb

     文件    7703036  2009-11-05 11:50  c++链接数据库用二进制存储图像,并能显示图像\Debug\Example.pch

     文件     552960  2009-11-05 11:50  c++链接数据库用二进制存储图像,并能显示图像\Debug\vc60.pdb

     文件     133792  2009-11-05 11:50  c++链接数据库用二进制存储图像,并能显示图像\Debug\StdAfx.obj

     文件     104778  2009-11-05 11:50  c++链接数据库用二进制存储图像,并能显示图像\Debug\ExampleDlg.obj

     文件      42683  2009-11-05 11:50  c++链接数据库用二进制存储图像,并能显示图像\Debug\Example.obj

............此处省略14个文件信息

评论

共有 条评论