5¡¢ÉÌÆ·µ¥Î»±í£º
Îå¡¢ÏêϸÉè¼Æ
5.1¡¢¼¸¸öÖ÷Òª¹¦ÄÜÄ£¿éµÄ³ÌÐòÁ÷³Ìͼ
1£©½øÐÐÉÌÆ·ÐÅÏ¢²Ù×÷ʱ£¬¿ÉʵÏÖ²éѯ£¬É¾³ý£¬Ë¢ÐºÍÈ«²¿ÏÔʾ¹¦ÄÜ£¬ÒÔÏÂÊǾßÌåµÄÁ÷³Ìͼ ¿ª ʼ
ÊäÈëÉÌÆ·
񅧏
²éѯ£¿ ɾ³ý£¿ ÏÔʾÐÅÏ¢ ɾ³ý³É¹¦ 9 ˢУ¿
ͼÈý¡¢ÉÌÆ·ÐÅÏ¢¹¦ÄÜÁ÷³Ìͼ
2£©½øÐÐÉÌÆ·½ø³ö¿âʱµÄ²Ù×÷ʱ£¬¿ÉʵÏÖÉÌÆ·µÄÌí¼Ó¹¦Äܺͽø³ö¿âʱµÄ¸÷ÖÖÐÅÏ¢£¬ÒÔÏÂÊǾßÌåµÄÁ÷³Ìͼ ¿ª ʼ Ìí¼Ó£¿ ÏÔʾ£¿ ÊäÈëÉÌÆ· ±àºÅ ÉÌÆ·´æ ÔÚ£¿ Ìí¼ÓÐÂÉÌÆ· Ìí ¼Ó ²é¹©»õ ÉÌÐÅÏ¢ ÊäÈëÐÅÏ¢ ¹©»õÉÌ´æÔÚ£¿ ¿ª ʼ 10
ͼËÄ¡¢ÉÌÆ·½ø³ö¿âÁ÷³Ìͼ
5.2¡¢¼¸¸ö¹Ø¼ü¹¦ÄܵĴúÂë»òËã·¨£º
1£©ÉÌÆ·Ìí¼Ó
CDatabase db;//¶¨ÒåÒ»¸ödbÀà
db.Open(\³¬ÊÐÉÌÆ·¹ÜÀí\´ò¿ª³¬ÊÐÉÌÆ·¹ÜÀíµÄÊý¾Ý¿â CString cs;
cs.Format(\INTO [dbo].[information]values('%s','%s','%s','%f','%d')\ m_pnumber,m_pname,m_pstyle,m_price,m_limitday);//ÏòÊý¾Ý¿âÖвåÈëÊý¾Ý db.ExecuteSQL(cs);//Ö´ÐÐSQLÓï¾ä MessageBox(\Ìí¼Ó³É¹¦!\2£©ÉÌÆ·ÐÅÏ¢µÄË¢ÐÂ
CDatabase db;
db.Open(\³¬ÊÐÉÌÆ·¹ÜÀí\ CString cs;
cs.Format(\\½«Êý¾Ý¿âÖеÄÊý¾Ý¸üРdb.ExecuteSQL(cs);//Ö´ÐÐSQLÓï¾ä
MessageBox(\ÃÜÂëÐ޸ijɹ¦£¬Ï´εǼÇëʹÓÃÐÂÃÜÂë\3£©É¾³ý
UpdateData(); CDatabase db;
db.Open(\³¬ÊÐÉÌÆ·¹ÜÀí\ CString cs;
cs.Format(\[dbo].[client] where cnumber='%s'\ÐÞ¸ÄÊý¾Ý¿âÖеÄÊý¾Ý
db.ExecuteSQL(cs);//Ö´ÐÐSQLÓï¾ä
GetDlgItem(IDC_EDIT2)->EnableWindow(true); MessageBox(\ɾ³ý³É¹¦!\4£©Ä£ºý²éѯ
m_list.DeleteAllItems(); productset set;
set.m_strFilter=\ CString cs;
cs.Format(\ set.m_strFilter+=cs;
set.m_strFilter+=\ set.Open();
for(int i=0;!set.IsEOF();i++,set.MoveNext())//ÏòÁбí¿Ø¼þÀïÌí¼Ó¼Ç¼ {
CString cs,pe,ls;
cs.Format(\
11
m_list.InsertItem(i,cs);
m_list.SetItemText(i,1,set.m_pname); m_list.SetItemText(i,2,set.m_pstyle); pe.Format(\ m_list.SetItemText(i,3,pe);
ls.Format(\ m_list.SetItemText(i,4,ls); }
5£©ÀûÓòåÈëÁÐ±í£¨ºûµûÐεģ©ÏÔʾȫ²¿ÐÅÏ¢ m_list.DeleteAllItems(); in_outset set; set.Open();
for(int i=0;!set.IsEOF();i++,set.MoveNext())//ÏòÁбí¿Ø¼þÀïÌí¼Ó¼Ç¼ {
CString cs,pe;
cs.Format(\ m_list.InsertItem(i,cs);
m_list.SetItemText(i,1,set.m_dateday);//Êý¾Ý¿âÖеÄÃû³Æ pe.Format(\ m_list.SetItemText(i,2,pe);
m_list.SetItemText(i,3,set.m_info); }
Áù¡¢ÏµÍ³×ܽá
6.1 ×ܽá
±¾ÏµÍ³ÊÇÔÚVisual C++6.0»·¾³Ï£¬ÓÃSQL Server 2008Êý¾Ý¿â¹ÜÀíϵͳÈí¼þ 1¡¢½øÈëµÇ¼½çÃæ
2¡¢½øÈëÖ÷½çÃ棬¿ÉÑ¡Ôñ²»Í¬µÄ°´Å¥½øÐв»Í¬µÄ¹¦ÄÜʵÏÖ
12