Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
ImageDBDoc.cpp
Package: ImageDB.rar [view]
Upload User: bst807
Upload Date: 2022-07-10
Package Size: 74k
Code Size: 3k
Category:
ADO-ODBC
Development Platform:
Visual C++
- // ImageDBDoc.cpp : implementation of the CImageDBDoc class
- //
- #include "stdafx.h"
- #include "ImageDB.h"
- #include "ImageDBDoc.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CImageDBDoc
- IMPLEMENT_DYNCREATE(CImageDBDoc, CDocument)
- BEGIN_MESSAGE_MAP(CImageDBDoc, CDocument)
- //{{AFX_MSG_MAP(CImageDBDoc)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CImageDBDoc construction/destruction
- CImageDBDoc::CImageDBDoc()
- {
- // TODO: add one-time construction code here
- }
- CImageDBDoc::~CImageDBDoc()
- {
- }
- BOOL CImageDBDoc::OnNewDocument()
- {
- if (!CDocument::OnNewDocument())
- return FALSE;
- // TODO: add reinitialization code here
- m_pConnection.CreateInstance(__uuidof(Connection));
- m_pConnection->ConnectionString="File Name=image.udl";
- m_pConnection->ConnectionTimeout=20;
- m_pConnection->Open("","Admin","",adConnectUnspecified);
- /*m_pConnection->Execute("insert player values('04','vc++',0x)",NULL,adCmdText);
- _variant_t varSQL;
- varSQL="select photo from player where pno='04'";
- m_pRecordset.CreateInstance(__uuidof(Recordset));
- m_pRecordset->Open(varSQL,m_pConnection.GetInterfacePtr(),adOpenDynamic,adLockOptimistic,adCmdText);
- _StreamPtr pStm;
- pStm.CreateInstance("ADODB.Stream");
- _variant_t varOptional(DISP_E_PARAMNOTFOUND,VT_ERROR);
- long lDataSize = m_pRecordset->GetFields()->GetItem("photo")->ActualSize;
- pStm->PutType(adTypeBinary);
- pStm->Open( varOptional,adModeUnknown,adOpenStreamUnspecified, _bstr_t(), _bstr_t());
- pStm->LoadFromFile("e:\folder.jpg");//读入文件
- _variant_t varBLOB=pStm->Read(adReadAll);
- m_pRecordset->GetFields()->GetItem("photo")->Value = varBLOB;
- m_pRecordset->Update();
- m_pRecordset->Close();*/
- // (SDI documents will reuse this document)
- return TRUE;
- }
- /////////////////////////////////////////////////////////////////////////////
- // CImageDBDoc serialization
- void CImageDBDoc::Serialize(CArchive& ar)
- {
- if (ar.IsStoring())
- {
- // TODO: add storing code here
- }
- else
- {
- // TODO: add loading code here
- }
- }
- /////////////////////////////////////////////////////////////////////////////
- // CImageDBDoc diagnostics
- #ifdef _DEBUG
- void CImageDBDoc::AssertValid() const
- {
- CDocument::AssertValid();
- }
- void CImageDBDoc::Dump(CDumpContext& dc) const
- {
- CDocument::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CImageDBDoc commands