提交 | 用户 | age
|
4b03ae
|
1 |
#pragma once
|
Q |
2 |
#import "c:/Program Files/Common Files/system/ado/msadox.dll"
|
|
3 |
#import "c:/Program Files/Common Files/system/ado/msado15.dll" no_namespace rename("EOF","adoEOF")rename("BOF","adoBOF")
|
|
4 |
|
|
5 |
/*
|
|
6 |
* Access 数据库接口程序
|
|
7 |
*
|
|
8 |
*
|
|
9 |
*
|
|
10 |
*
|
|
11 |
*/
|
|
12 |
|
|
13 |
int CreateMdb(CString MdbPathName);
|
|
14 |
int OpenMdb(CString MdbPathFileName,_ConnectionPtr & pConnectionPtr);
|
|
15 |
int CloseMdb(_ConnectionPtr & pConnection);
|
|
16 |
int RunSql1( _ConnectionPtr pConnection,CString SqlStr1);//运行没有返回值的SQL语句
|
|
17 |
int RunSql2( _ConnectionPtr pConnection,CString SqlStr1,_RecordsetPtr & pRecordsetPtr);//运行有返回值的SQL语句
|
|
18 |
|
|
19 |
class MyDataBase
|
|
20 |
{
|
|
21 |
public:
|
|
22 |
CString MdbPathName;
|
|
23 |
CString LastMdbPathName;
|
|
24 |
_ConnectionPtr m_ConnectionPtr;
|
|
25 |
_RecordsetPtr m_RecordsetPtr;
|
|
26 |
int IsOpened;
|
|
27 |
public:
|
|
28 |
MyDataBase();
|
|
29 |
|
|
30 |
~MyDataBase();
|
|
31 |
private:
|
|
32 |
protected:
|
|
33 |
public:
|
|
34 |
int CreateMdb();
|
|
35 |
|
|
36 |
//创建数据库表和字段。
|
|
37 |
int CreateMdbStruct();
|
|
38 |
int AddToMdb(int channel,CString SN);
|
|
39 |
int CheckMdb1(CString SerialNo);
|
|
40 |
int AddToOutPutDataBase(int Index,CString ProductCode,CString ProductType, CString ProductDesc,int ColorNo,int Quality,int PowerNo,int ProductLineNo);
|
|
41 |
};
|