vb.net²Ù×÷Êý¾Ý¿âÖ®ACCESS£¨1£©
Ò»Ö±ÏëдÏÂÊý¾Ý¿â²Ù×÷·½ÃæµÄ£¬Ö»ÊÇûʲôʱ¼ä£¨ºÃÏñÊǽè¿Ú£¬Ó¦¸ÃÊÇÀÁ»òÕßûÐÄÇé°É£¬ºÇºÇ£©¡£×î½ü·¢ÏÖCSDNÉÏ
»¹ÊÇÿÌìÓÐÈËÒªÎÊÕâЩÄÚÈÝ£¬ÎÒÓеÄʱºò¾ÍÀÁµÄ»Ø´ð£¬ºÇºÇ£¬Ö÷Òª²»¶ÏµÄÈ¥ÕÒ´úÂë¸øËûÃÇÀÛ°¡¡£ËùÒÔ»¹ÊÇÌý¸ßÈ˵ģ¬À´
¸öÒ»ÀÍÓÀÒÝ£¬×Ô¼ºÖØÐÂÎÂÏ°Ï£¬Ò²ºÃ¸øÆäËûÈËһЩ°ïÖú¡£
Õâ¸öÊý¾Ý¿â²Ù×÷ÎÒ»áд¸öϵÁÐÐԵİɣ¬ ÏÈдACCESS¡£²»ÖªµÀÕâ¸öһƪÄÜд¶à³¤£¬²»ÐÐÎÒÒª·Ö¼¶ÆªÁË¡£
ÆäʵACCESSµÄ²Ù×÷»ù±¾¶¼ÆäËûÊý¾Ý¿âÒ»¸öÑù£¬Ö»Êdz¤µÄ²»Ò»Ñù£¬´ó¼ÒÓÐÖÖη¾å»¹ÊÇÄ°Éú£¿ÆäʵÊÇÖ½ÀÏ»¢À²¡£
ºÃÁË£¬ÏÈ˵Á¬½Ó·½Ã棺
Public Function DB_CnStr() As String
Return "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "./FlashCard.mdb"
End Function
ÉÏÃæµÄ´úÂë¾ÍÊÇÒ»¸ö¹«Óú¯Êý£¬ÒòΪ¶à´¦ÒªÓõ½£¬ÀÁµÃÿ´Î¶¼Ð´£¬Ö±½Óµ÷ÓÃϾÍOKÁË¡£Öм䲿·Ö¾ÍÊÇÒ»¸öÊý¾Ý¿âÁ¬½Ó×Ö´®£¬
Data Source=" & Application.StartupPath & "./FlashCard.mdb"ÕâÀï¾ÍÊÇÉèÖÃÄãµÄÊý¾Ý¿âµØÖ·£¬¾ßÌå´úÂë²»ÓÃÎÒ½âÊÍÁË°É£¿
Èç¹ûÓÐÃÜÂë¾ÍÐèÒªÔÙ¼ÓÒ»¸öÕ˺ÅÃÜÂëÁË.
User ID=myUsername;Password=myPassword
Õâ¸ö×ÊÁÏÌ«¶àÁË£¬Ò²»ù±¾²î²»¶à£¬Ëæ±ã×¥×¥¾ÍÀ´¿©¡£
ÄÇÏÂÃæÊDz»ÊÇҪ˵˵ÈçºÎ²Ù×÷ÁË£¿¶Ô£¬²Ù×÷Êý¾Ý¿âÂÎ޷ǾÍÊDzéѯ£¬Ôö¼Ó£¬É¾³ý£¬ÐÞ¸ÄÕ⼸ÖÖ¡£´úÂë·½Ãæ»ù±¾Ò²²î²»¶àÁË£¬Ö»ÊÇSQLÉÏÒª»»Ãû×Ö¡£·Ï»°²»ËµÁË£¬Ö±½ÓÉÏ´úÂëºÃÁË¡£
‘ÕâÀï¾ÍÊÇ“²éѯ”²¿·Ö¿©£¬¾ßÌåÔõô²éÊÇдSQLµÄÎÊÌâÁË£¬ÏȲ»ÌÖÂÛ
’ÏÈÁ¬½Ó
DBConnection.ConnectionString = DB_CnStr()
DBConnection.Open()
'¿ªÊ¼²éѯ
Dim sql As New System.Text.StringBuilder
sql.Append(" SELECT * from WORDINFO")
sql.Append(" WHERE CLASS='").Append(Classstring).Append("'")
Dim cmd As New OleDb.OleDbCommand(sql.ToString, DBConnection)
Dim RS As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(cmd)
DT = New DataTable
RS.Fill(DT)
DBConnection.Close()
'Óв鵽ÔòÏÔʾ³öÀ´
Rowcount = DT.Rows.Count
If Rowcount = 0 Then
MsgBox("No Reco
Ïà¹ØÎĵµ£º
µÚÒ»´ÎÕýʽȥÉÏÃ×ÀÏʦµÄ¿Î£¬Õâ´ÎÊǺ®¼ÙÀ´ºóµÄµÚÒ»½Ú¿Î£¬ÄÚÈÝÖ÷ÒªÊǽ»Á÷һϺ®¼ÙµÄѧϰÇé¿ö¡£
Ê×ÏÈÊÇÑÔÐÐÎÊÌ⣺ȥ»ú·¿ÉÏ¿Îʱ£¬´øÐØÅÆ¡¢±Ê¼Ç±¾¡¢±Ê¡¢¡¶Visual Basic ³ÌÐòÉè¼Æ¡·¡¢Ð¬Ìס¢ÑÛ¾µ£¬ÊÖ»úÄܲ»´ø¾Í²»´ø£»±ðÈË·¢ÑÔʱ£¬ÏÔʾÆ÷¹Øµô£¬ÃæÏò¶Ô·½ÒÔʾ×ð¾´¡£
......
Format[$] ( expr [ , fmt ] )
format ·µ»Ø±äÌåÐÍ
format$ Ç¿ÖÆ·µ»ØΪÎı¾
--------------------------------
Êý×ÖÀàÐ͵ĸñʽ»¯
--------------------------------
¹Ì¶¨¸ñʽ²ÎÊý£º
General Number ÆÕͨÊý×Ö£¬Èç¿ÉÒÔÓÃÀ´È¥µôǧλ·Ö¸ôºÅ
format$("100 ......
1¡¢´´½¨¿Ø¼þ£ºlbl1¡¢txt1¡¢lbl2¡¢cmd1
2¡¢lbl1.caption=ÊäÈëÈÕÆÚ£¨ÈÎÒ»ÖÖÕýÈ·¸ñʽ£©£º
ÉèÖÃlbl1¡¢txt1¡¢lbl2¡¢cmd1µÄ×ÖÌå´óС¼°ÑÕÉ«£»
3¡¢Ë«»÷°´Å¥“È·ÈÏ”£¬Ìí¼Ó´úÂ룬Ч¹ûΪ£º
Option Explicit
Private Sub cmd1_Click()
&nb ......
len£¨string£©£º¼ÆËã×Ö·û´®³¤¶Èº¯Êý¡£·µ»Ø×Ö·û´®stringÖÐ×Ö·ûµÄ¸öÊý¡£Ò»¸öºº×ÖΪһ¸ö×Ö·û£¬¿Õ¸ñҲΪһ¸ö×Ö·û£¬¿Õ×Ö·û´®µÄ³¤¶ÈΪ0.
Ltrim£¨string£©¡¢Rtrim£¨string£©¡¢Trim£¨string£©£º
Ltrim£¨string£©º¯Êý¹¦ÄÜÊÇ·µ»Øɾ³ýÁË×Ö·û´®string×ó±ß¿Õ¸ñÖ®ºóÊ£ÓàµÄ²¿·Ö¡£
Rtrim£¨string£©º¯Êý¹¦ÄÜÊÇ·µ»Øɾ³ýÁË×Ö·û´®ÖÐstringÓ ......
LOFº¯Êý£ºLOF£¨ÎļþºÅ£©--·µ»ØÎļþºÅËù´ú±íÎļþµÄ³¤¶È£¬³¤¶ÈÒÔ×Ö½ÚΪµ¥Î»¡£
LOCº¯Êý£ºLOC£¨ÎļþºÅ£©--·µ»ØÎļþºÅËù´ú±íÎļþµÄ¶ÁдλÖã¬LOCº¯ÊýµÄ·µ»ØֵΪlongÊý¾ÝÀàÐÍ¡£¶ÔÓÚËæ»úÎļþ£¬·µ»ØµÄΪÉÏÒ»´Î¶ÔÎļþ½øÐжÁ³ö»òдÈëµÄ¼Ç¼ºÅ£»¶ÔÓÚ¶þ½øÖÆÎļþ£¬·µ»ØµÄΪÉÏÒ»´Î¶Á³ö»òдÈëµÄ×Ö½ÚλÖ㻶ÔÓÚ˳ÐòÎļþ£¬·µ»ØµÄÊÇÎļþµÄµ ......