ÓйØAccessÊý¾Ý¿â´æÈ¡µÄÎÊÌâ - C++ Builder / »ù´¡Àà
ÈçºÎ½«Ò»¸öListBoxÖеÄÊý¾Ý´æÔÚÊý¾Ý¿âÖеÄÒ»¸ö×Ö¶ÎÏÂÃ棬²¢ÇÒÿÌõ¼Ç¼µÄ×Ö·û´®¸öÊý²»Ò»¶¨ ÒÔ¼°ÈçºÎ´ÓÊý¾Ý¿âÖжÁÈ¡¸ÃListBoxÖеÄËùÓмǼ
C/C++ code:
//´æÈëÊý¾Ý¿â
void __fastcall TForm1::Button5Click(TObject *Sender)
{
for(int i=0;i<ListBox1->Count;i++)
{
AnsiString Str = ListBox1->Items->Strings[i] ;
AnsiString SQL ;
SQL.sprintf("INSERT INTO MyTable(PriKey) VALUES('%s')",Str.c_str()) ;
ADOQuery1->Close() ;
ADOQuery1->SQL->Clear() ;
ADOQuery1->SQL->Add(SQL) ;
ADOQuery1->ExecSQL() ;
}
}
C/C++ code:
//¶Á³öÊý¾Ý
void __fastcall TForm1::Button5Click(TObject *Sender)
{
AnsiString SQL = "select * from MyTable" ;
ADOQuery1->Close() ;
ADOQuery1->SQL->Clear() ;
ADOQuery1->SQL->Add(SQL) ;
ADOQuery1->Open() ;
while(!ADOQuery1->Eof)
{
ListBox1->Items->Add(ADOQuery1->FieldByName("PriKey")->AsString) ;
ADOQuery1->Next() ;
}
}
Â¥ÉÏ´úÂëÊÇ°Ñÿ¸öÏîÄ¿ÒÔ¶ººÅ·Ö¸ô´æÔÚ×Ö¶ÎÖеÄ
ÏÈ°Ñ×Ö¶ÎÀàÐÍÉèÖÃΪtext
C/C++ code:
void __fastcall TForm1::Button5Click(T
Ïà¹ØÎÊ´ð£º
ÓÐÒ»10*10¾ØÕ󣬳ýÈ¥µÚÒ»¸öµã£¨0£¬0£©ºÍ×îºóÒ»µã£¨9£¬9£©£¬»¹Óа˸öµãΪ1£¬ÆäËû¶¼Îª0£¬ÒªÇóÓöþάÊý×é±íʾ¡£°Ë¸öµãÊÇËæ»úÉú³ÉµÄ£¬±àдÏà¹Ø³ÌÐò±íʾ¾ØÕóËùÓпÉÄÜÇé¿ö¡£
ÕæÐÄÇó½Ì¸÷λ¸ßÊÖ£¬°¥£¡±¾ÈËÌ«²ËÁË£¡ºÇºÇ£¡
......
´íÎóÌáʾ£º
Error creating bean with name 'DAOProxy' defined in class path resource [appcontext.xml]: Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionMana ......
visual c++2008Ëٳɰ棬²»ÄܱàÒëC³ÌÐòÂð£¿Èç¹ûÄÜÊÇÔõô¿ªÊ¼µÄ°¡£¿ÓÃËü´øµÄÃüÁîÌáʾµ¥Ôª³ýÍâ ¡£
н¨¹¤³Ì£¨¿Õ¹¤³Ì»òwin32¿ØÖÆ̨£©
¾ø¶Ô¿ÉÒÔ¡£½¨Á¢win32¿ØÖÆ̨³ÌÐò¾Í¿ÉÒÔ
ÒýÓÃ
н¨¹¤³Ì£¨¿Õ¹¤³Ì»òwin32¿ØÖÆ̨£ ......
ʹÓÃACCESS×î´óµÄÒþ»¼¾ÍÊDz»°²È«¡£½ñÌì¶ÔACCESSÊý¾Ý¿âÉèÖÃÁËÒ»¸öÃÜÂ룬±ØÐëʹÓÃÃÜÂë²ÅÄÜ´ò¿ª£¬µ«ÊÇÔÚ³ÌÐòÖÐÈ´ÎÞ·¨Á¬½ÓÊý¾Ý¿âÁË¡£´ó¼ÒÖªµÀʹÓÃÓû§ÃûºÍÃÜÂ룬ÈçºÎÁ¬½ÓACCESSÊý¾Ý¿â£¿Ã²ËÆACCESSµÄÓû§Ãû»¹²»ÖªµÀ£¿Ö»Öª ......