Development of personal Transaction Management Information System Using VC ++
Tools
Http://blog.csdn.net/bcbobo21cn/article/details/44200205
Demo project
Http://pan.baidu.com/s/1slaISnr
1. Develop a personal transaction management information system; change it from the next source code on the Internet;
Source
Http://www.newxing.com/Code/VC/data/4004.html
Run the following code,
2. Run and an error occurs. ODBC is used to access the database, rather than ADO;
3. view the connection menu code,
It is an error reported by db. Open;
4. Create an ODBC data source,
No access driver found;
See,
Http://blog.csdn.net/wang379275614/article/details/7803576
5. Go to the following directory and configure ODBC,
Select the mdb database. The configuration is successful;
6. Run and log on;
The password is incorrect. However, the password is correct. Check the code;
If (strPasswd = CCrypt: Encrypt (m_strPasswd, 123 )&&
This sentence may be faulty, because the database obtains strPasswd and updates the data variable to get the interface input content to m_strPasswd. The two values are actually one. encryption will not be equal to itself;
CCrypt: Encrypt () the functions of this function have not yet been clarified; try again next time;
The value after string encryption is displayed at the breakpoint;
Comment out the encryption code first;
7. Run it;
8. Change the menu to the menu of the personal transaction management information system;
9. In the resource-string table, modify the title of the Main Box.
10. Open the database table;
Tools:
Http://blog.csdn.net/bcbobo21cn/article/details/51000041
Modify the content in the JOB table to the device category table. The device category is the personal item category, clothing, electronic equipment, and other categories;
11 Insert the DataGrid Control,
Error, see,
Http://blog.csdn.net/zhongjling/article/details/7787626
12. In the add device Category Management dialog box, insert the DataGrid Control and create an interface as follows;
13. A new class is required in the create dialog box.
14. Select the class required by the DataGrid Control;
15 if the code is used, open the record set and bind it;
Error; after research, the reason is that the above Code is actually used to access the database DataGrid In ADO mode; ODBC mode, all online materials are currently added in one row; such
Http://www.vckbase.com/index.php/wv/248
And so on;
Change the DataGrid Control to ListCtrl.
Add the following code based on relevant online materials;
BOOL shblbDlg: OnInitDialog ()
{
CDialog: OnInitDialog ();
// TODO: Add extra initialization here
M_list3.SetExtendedStyle (LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES );
M_list3.InsertColumn (0, _ T ("Category Number"), LVCFMT_IMAGE | LVCFMT_LEFT );
M_list3.InsertColumn (1, _ T ("category name "));
Int j;
For (j = 0; j <2; j ++)
{
M_list3.SetColumnWidth (j, 180 );
}
CRecordset rs (& db); // Dataset
CString str1, str2;
Rs. Open (CRecordset: forwardOnly, "select * from JOB ");
Int I = 0;
// Rs. MoveFirst ();
Do
{
// M_list3.InsertItem (I, rs. m_column1, 0 );
Rs. GetFieldValue ("CODE", str1 );
Rs. GetFieldValue ("DESCRIPTION", str2 );
M_list3.InsertItem (I, str1, 0); // insert a row
M_list3.SetItemText (I, 1, str2); // set other column data
I ++;
Rs. MoveNext ();
} While (! Rs. IsEOF ());
// Rs. MoveFirst ();
// M_shblbdlg.SetRefDataSource (LPUNKNOWN) rs. GetRecordset ());
// M_shblbdlg.SetRefDataSource (LPUNKNOWN) rs. Requery ());
Return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages shold return FALSE
}
Database records have been obtained. However, inserting data to ListCtrl has some problems. Only one field is displayed, and no column header is displayed;
You need to select the list style in the control properties,
Records are arranged by rows;