VC + + Development of personal affairs management Information System

Source: Internet
Author: User
Tags mdb database

Tools

http://blog.csdn.net/bcbobo21cn/article/details/44200205

Demoproject

Http://pan.baidu.com/s/1slaISnr


1 Development of Personal affairs management information System; From the Web next source code to change.

Source

Http://www.newxing.com/Code/VC/data/4004.html

The source code executes such as the following,

2 execution. An ODBC Access database, not ADO;


3 View the code for the Connection menu,




Is DB. Open a quote of the wrong;

4 Create an ODBC data source,


found no access driver;

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

Reason,

http://blog.csdn.net/wang379275614/article/details/7803576

5 Enter the following folder for example, and then configure ODBC.



Select MDB database, configure successfully;





6 execution. Login

Password is not correct. But the loser is right. Look at the code;

if (strpasswd = = Ccrypt::encrypt (m_strpasswd, 123) &&

There may be a problem with this sentence because the database is taken to STRPASSWD. By updating the data variables to get interface input content to M_STRPASSWD, these two values are actually one; encryption will not be equal to itself;

Ccrypt::encrypt () The function of this function is not yet clear;



Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

The next breakpoint can see the value after the string is encrypted;

First stare at the encryption code.

7 to execute them.



8 Modify the menu for the Personal affairs management information System;





9 in the resource-string table, change the title of the main box



10 Open the database table;

Tools:

http://blog.csdn.net/bcbobo21cn/article/details/51000041

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

Change the contents of the job table to the contents of the Device category table. Category of equipment is the category of personal goods, clothing, electronic equipment and other categories;

11 Insert the DataGrid control,

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">



Mistakes, references,

http://blog.csdn.net/zhongjling/article/details/7787626

12 Join the Device Category Management dialog box. Insert the DataGrid control and make an interface such as the following.



13 New dialog box needs to add a class


14 Select the class required for the DataGrid control;


15 For example, in code, open the recordset and bind it.

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

The reason for this is that the code is actually a DataGrid binding for ADO access to the database, and ODBC, where all the online data is now, one row to add the data. Such as

http://www.vckbase.com/index.php/wv/248

such as


Replace the DataGrid control with Listctrl



Add the following code to the relevant information on the Internet;

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); Data set
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 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 should return FALSE
}

The database record has been taken, but there is a little problem inserting the data into the Listctrl. Only one field is displayed. and the column header is not displayed;



You need to select the list style in the control properties.

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

Records will be arranged by line;


VC + + Development of personal affairs management Information System

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.