資源簡介
VC讀取數據庫數據并繪曲線圖.rar

代碼片段和文件信息
//?MainFrm.cpp?:?implementation?of?the?CMainframe?class
//
#include?“stdafx.h“
#include?“Readdata.h“
#include?“MainFrm.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CMainframe
IMPLEMENT_DYNCREATE(CMainframe?CframeWnd)
BEGIN_MESSAGE_MAP(CMainframe?CframeWnd)
//{{AFX_MSG_MAP(CMainframe)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
static?UINT?indicators[]?=
{
ID_SEPARATOR???????????//?status?line?indicator
ID_INDICATOR_CAPS
ID_INDICATOR_NUM
ID_INDICATOR_SCRL
};
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?construction/destruction
CMainframe::CMainframe()
{
//?TODO:?add?member?initialization?code?here
//調用Register函數注冊數據庫
//獲取當前文件路徑
char?*path=new?char[100];
::GetCurrentDirectory(100path);
CString?path1;
path1.Format(“%s“path);
CString?path2=path1+“\\data.mdb“;
RegisterDBSource(“data.mdb“path2);
}
CMainframe::~CMainframe()
{
}
BOOL?CMainframe::PreCreateWindow(CREATESTRUCT&?cs)
{
if(?!CframeWnd::PreCreateWindow(cs)?)
return?FALSE;
//?TODO:?Modify?the?Window?class?or?styles?here?by?modifying
//??the?CREATESTRUCT?cs
return?TRUE;
}
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?diagnostics
#ifdef?_DEBUG
void?CMainframe::AssertValid()?const
{
CframeWnd::AssertValid();
}
void?CMainframe::Dump(CDumpContext&?dc)?const
{
CframeWnd::Dump(dc);
}
#endif?//_DEBUG
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?message?handlers
void?CMainframe::RegisterDBSource(CString?strDSName?CString?strDBPath)
{
HKEY?hKey;
DWORD?nLabel;?
CString?strbaseKey?=?_T(“SOFTWARE\\ODBC\\ODBC.INI“);
CString?strMid?=?strbaseKey?+?_T(“\\ODBC?Data?Sources“)?;
if(strDSName.IsEmpty())?return;
if(strDBPath.IsEmpty())?return;
CString?strDataSource?=?strbaseKey?+?_T(“\\“)?+?strDSName;
CString?strMdb?=?_T(“Microsoft?Access?Driver?(*.mdb)“);
CString?strDBDriver?=?_T(“C:\\WINNT\\System32\\odbcjt32.dll“);
CString?strFIL?=?_T(“Ms?Access;“);
CString?strUID?=?_T(““);
RegCreateKeyEx(HKEY_CURRENT_USER
strMid
0?
NULL?
REG_OPTION_NON_VOLATILE?
KEY_ALL_ACCESS
NULL
&hKey?
&nLabel?);//獲取數據源鍵值句柄
RegSetValueEx(hKey
strDSName
0
REG_SZ
(const?unsigned?char?*)((LPCTSTR)strMdb)
strlen((LPCTSTR)strMdb)+1);///設置數據源類型
RegCreateKeyEx(HKEY_CURRENT_USER
strDataSource
0?
NULL?
REG_OPTION_NON_VOLATILE?
KEY_ALL_ACCESS
NULL
&hKey?
&nLabel?);//創建數據源子鍵
RegSetValueEx(hKey
_T(“DBQ“)
0
REG_SZ
(const?unsigned?char?*)((LPCTSTR)strDBPath)
strlen((LPCTSTR)strDBPath)+1);//數據庫表的全路徑
RegSetValueEx(hKey
_T(“Driver“)
0
REG_SZ
(const?unsigned?char?*)((LPCTSTR)strDBDriver)
strlen((LPCTST
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????352??2008-12-06?17:22??VC讀取數據庫數據并繪曲線圖\data.txt
?????文件???????3673??2008-12-18?15:26??VC讀取數據庫數據并繪曲線圖\MainFrm.cpp
?????文件???????1488??2008-12-18?15:25??VC讀取數據庫數據并繪曲線圖\MainFrm.h
?????文件??????28404??2010-01-29?10:10??VC讀取數據庫數據并繪曲線圖\Readdata.aps
?????文件???????2773??2010-01-29?10:12??VC讀取數據庫數據并繪曲線圖\Readdata.clw
?????文件???????4339??2008-12-05?15:31??VC讀取數據庫數據并繪曲線圖\Readdata.cpp
?????文件???????4913??2008-12-05?21:00??VC讀取數據庫數據并繪曲線圖\Readdata.dsp
?????文件????????541??2008-12-05?10:06??VC讀取數據庫數據并繪曲線圖\Readdata.dsw
?????文件???????1378??2008-12-05?10:06??VC讀取數據庫數據并繪曲線圖\Readdata.h
?????文件?????410624??2010-01-29?10:13??VC讀取數據庫數據并繪曲線圖\Readdata.ncb
?????文件??????56832??2010-01-29?10:13??VC讀取數據庫數據并繪曲線圖\Readdata.opt
?????文件???????5719??2010-01-29?10:10??VC讀取數據庫數據并繪曲線圖\Readdata.plg
?????文件??????11598??2009-05-20?10:57??VC讀取數據庫數據并繪曲線圖\Readdata.rc
?????文件???????1782??2008-12-05?10:06??VC讀取數據庫數據并繪曲線圖\ReaddataDoc.cpp
?????文件???????1497??2008-12-05?10:06??VC讀取數據庫數據并繪曲線圖\ReaddataDoc.h
?????文件??????18296??2009-05-21?17:37??VC讀取數據庫數據并繪曲線圖\ReaddataView.cpp
?????文件???????2574??2008-12-17?20:47??VC讀取數據庫數據并繪曲線圖\ReaddataView.h
?????文件???????4359??2008-12-05?10:06??VC讀取數據庫數據并繪曲線圖\ReadMe.txt
?????文件???????1360??2008-12-05?14:39??VC讀取數據庫數據并繪曲線圖\Record.cpp
?????文件???????1311??2008-12-17?20:32??VC讀取數據庫數據并繪曲線圖\Record.h
?????文件?????921600??2009-07-23?16:16??VC讀取數據庫數據并繪曲線圖\Release\data.mdb
?????文件??????40960??2010-01-29?10:10??VC讀取數據庫數據并繪曲線圖\Release\Readdata.exe
?????文件??????27262??2009-05-01?13:57??VC讀取數據庫數據并繪曲線圖\Release\論文數據.TXT
?????文件????????766??2008-12-05?20:50??VC讀取數據庫數據并繪曲線圖\res\PowerDes.ico
?????文件???????1078??2008-12-05?10:06??VC讀取數據庫數據并繪曲線圖\res\Readdata.ico
?????文件????????400??2008-12-05?10:06??VC讀取數據庫數據并繪曲線圖\res\Readdata.rc2
?????文件???????1078??2008-12-05?10:06??VC讀取數據庫數據并繪曲線圖\res\ReaddataDoc.ico
?????文件???????1078??2008-12-05?10:06??VC讀取數據庫數據并繪曲線圖\res\Toolbar.bmp
?????文件???????1015??2008-12-08?20:07??VC讀取數據庫數據并繪曲線圖\Resource.h
?????文件???????2318??2008-12-17?20:01??VC讀取數據庫數據并繪曲線圖\Seedata.cpp
............此處省略10個文件信息
- 上一篇:QQ聊天記錄查看器V1.1.0.0綠色版.rar
- 下一篇:WT588D播放語音程序
評論
共有 條評論