
数据库/COM
zgl7903
iPad回帖太累人
展开
-
C++ EXCEL Sample
// Copyright (c) Microsoft Corporation. All rights reserved.//// This source code is only intended as a supplement to the// Microsoft Visual C++ Language Reference and related// electronic documentation provided with Microsoft Visual C++.// See the.翻译 2020-10-18 10:13:57 · 638 阅读 · 0 评论 -
ODBC 枚举数据表名
#include <afxdb.h>class CDatabaseEx : public CDatabase{ DECLARE_DYNAMIC(CDatabaseEx)public: CDatabaseEx(){};public: int EnumTables(CStringArray &sTabs);};IMPLEMENT_DYNAMI...原创 2020-04-06 12:53:43 · 466 阅读 · 1 评论 -
SQLGetInstalledDrivers 获取ODBC已经安装的驱动列表
#include <ODBCINST.H>void GetSQLDriverList(){ TCHAR szDrivers[4096]; memset(szDrivers, 0, sizeof(szDrivers)); WORD wRet = 0; if(SQLGetInstalledDrivers(szDrivers, _countof(szDriv...原创 2017-07-05 11:57:46 · 2898 阅读 · 3 评论 -
在ActiveX中调出属性页
HRESULT CTestActiveXCtrl::ShowPorpertyPages(void){ AFX_MANAGE_STATE(AfxGetStaticModuleState()); // TODO: 在此添加调度处理程序代码 HRESULT hr = S_OK; LPUNKNOWN lpDisp = GetIDispatch(FALSE); LCID lcid原创 2015-05-13 05:16:17 · 947 阅读 · 1 评论 -
操作 WORD 画线
#import "office/MSO.DLL" rename("RGB", "msRGB")#import "office/VBE6EXT.OLB" no_namespace #import "office/MSWORD.OLB" \ rename("FindText", "msFindText")\ rename("ExitWindows","ExitWindowsEx")v原创 2013-11-26 09:40:02 · 1817 阅读 · 0 评论 -
枚举剪切板数据和格式名称
if(OpenClipboard()) //open clipboard { UINT uFormat = 0; while(uFormat = EnumClipboardFormats(uFormat)) //emulate format { HGLOBAL hGlobal = GetClipboardData(uFormat); //ge原创 2013-08-30 15:42:58 · 1398 阅读 · 0 评论 -
UTF8 ANSI 相互转换的函数
#include #include LPCSTR AnsiToUtf8(LPCSTR Ansi){ int WLength = MultiByteToWideChar(CP_ACP, 0, Ansi, -1, NULL, 0); LPWSTR pszW = (LPWSTR) _alloca((WLength+1) * sizeof(WCHAR)); MultiByte原创 2010-10-02 16:37:00 · 4292 阅读 · 0 评论 -
ODBC获取记录记录数
//ODBC 的 CRecordSet 提供了一个函数GetRecordCount 用于返回记录条数//但是MSDN上有这样的说明/*The record count is maintained as a "high water mark," the highest-numbered record yet seen as the user moves through the records原创 2012-03-08 22:23:20 · 4290 阅读 · 0 评论 -
ActiveX控件添加可见枚举类型
// MfcActiveX.idl : ActiveX 控件项目的类型库源。// 此文件将由 MIDL 编译器工具处理以// 产生类型库(MfcActiveX.tlb),该类型库将成为// MfcActiveX.ocx.#include #include [ uuid(D3AAF2EE-E0B4-4526-910E-A246AF6E467E), version(原创 2012-04-28 10:54:50 · 2244 阅读 · 0 评论 -
IShellFolder 接口浏览文件夹(一)
void SpecialFolder_Browse(HWND hwnd){ LPMALLOC g_pMalloc; /* Gets the Shell's default allocator */ if (::SHGetMalloc(&g_pMalloc) == NOERROR) { BROWSEINFO bi; LPSTR lpBuffer; LPIT原创 2008-06-23 09:19:00 · 3631 阅读 · 0 评论 -
BYTE 和 COleVariant 相互转换
#include BOOL GetBinaryFromVariant(COleVariant & ovData, BYTE ** ppBuf, unsigned long * pcBufLen){ BOOL fRetVal = FALSE; //Binary data is stored in the variant as an array of unsigned ch原创 2008-06-11 17:06:00 · 3376 阅读 · 0 评论 -
调出Activex控件属性页
BOOL ViewControl_PropertyPage(HWND hParent, CWnd *pCtrl){ LCID m_lcid=GetUserDefaultLCID(); //User locale IDispatch *m_pIDispatch = (IDispatch *)pCtrl->GetControlUn原创 2009-08-04 18:16:00 · 1453 阅读 · 0 评论 -
格式化OLE错误代码
#include #include #include CString OleFormatScode(LPSTR lpszMsg, SCODE sc) { #define CASE_SCODE(sc) case sc: szErrName.Format(_T("%s"),#sc); break; CString szErrName; switch (sc)原创 2010-03-04 09:18:00 · 2549 阅读 · 0 评论 -
在MFC ODBC 中 使 CRecordSet 指定字段变为只读字段
void CFsaSet::DoFieldExchange(CFieldExchange* pFX){ //{{AFX_FIELD_MAP(CFsaSet) pFX->SetFieldType(CFieldExchange::outputColumn); switch(pFX->m_nOperation) { case(CFieldExchange::Na原创 2010-08-27 17:18:00 · 1020 阅读 · 0 评论 -
EXCEL行列坐标与字符串的相互转换
//行列坐标转换为字符串BOOL Conv_Row_Col_to_Str(CString &str, long row, long col){ if(row 65535 || col 256) return(false); col--;#define DECIMAL26_COL ('Z'-'A'+1) long r_Col[]原创 2010-10-03 10:07:00 · 2772 阅读 · 0 评论