VB.NETѹËõACCESSÊý¾Ý¿â
'´´½¨Êý¾Ý¿â
Private Sub Create(ByVal mdbPath As String)
If File.Exists(mdbPath) Then
Throw New Exception("Ä¿±êÊý¾Ý¿âÒѾ´æÔÚ£¬ÎÞ·¨´´½¨")
End If
mdbPath = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + mdbPath
Dim cat As ADOX.Catalog = New ADOX.Catalog()
cat.Create(mdbPath)
End Sub
'''' <summary>
'''ѹËõÐÞ¸´Êý¾Ý¿â
''' </summary>
''' <param name="mdbPath"> ±»Ñ¹ËõµÄÊý¾Ý¿â·¾¶+Êý¾Ý¿âÎļþÃû</param>
''' <remarks></remarks>
Public Sub Compact(ByVal mdbPath As String)
'If Not File.Exists(mdbPath) = False Then '¼ì²éÊý¾Ý¿âÊÇ·ñÒÑ´æÔÚ
' Throw New Exception("Ä¿±êÊý¾Ý¿â²»´æÔÚ£¬ÎÞ·¨Ñ¹Ëõ")
'End If
Dim temp = GetSysDatePartTime()
Dim FilePath As String = mdbPath.Substring(0, mdbPath.LastIndexOf("\") + 1)
Dim DbFileName As String = mdbPath.Substring(mdbPath.LastIndexOf("\") + 1, mdbPath.Length - mdbPath.LastIndexOf("\") - 1)
File.Copy(mdbPath, FilePath + "DbBak\Bak" + temp + ".mdb", True)
Dim StrProvid As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
Dim jt As JRO.JetEngineClass = New JRO.JetEngineClass()
jt.CompactDatabase(StrProvid + mdbPath, StrProvid +
Ïà¹ØÎĵµ£º
Microsoft AccessÊÇÒ»ÖÖ¹ØϵʽÊý¾Ý¿â£¬¹ØϵʽÊý¾Ý¿âÓÉһϵÁбí×é³É£¬±íÓÖÓÉһϵÁÐÐкÍÁÐ×é³É£¬Ã¿Ò»ÐÐÊÇÒ»¸ö¼Ç¼£¬Ã¿Ò»ÁÐÊÇÒ»¸ö×ֶΣ¬Ã¿¸ö×Ö¶ÎÓÐÒ»¸ö×Ö¶ÎÃû£¬×Ö¶ÎÃûÔÚÒ»¸ö±íÖв»ÄÜÖظ´¡£ ¡¡¡¡
±íÓë±íÖ®¼ä¿ÉÒÔ½¨Á¢¹Øϵ£¨»ò³Æ¹ØÁª£¬Á¬½Ó£©£¬ÒÔ±ã²éѯÏà¹ØÁªµÄÐÅÏ¢¡£AccessÊý¾Ý¿âÒÔÎļþÐÎʽ±£´æ£¬ÎļþµÄÀ©Õ¹ÃûMDB¡£ ¡¡¡¡
......
ÔÚACCESS(2007)Êý¾Ý¿âÖУ¬ÓÐÕâÑùÒ»¸öÄ£ºý²éѯ£¬
select postId,postName,postType,left(postTime,10) as postTimes from PostInfo where postUser like '*ÖÜ·¼*'
ÔÚÊý¾Ý¿â²éѯºó½á¹ûÏÔʾÕýÈ·£¬¿ÉÊÇ·ÅÔÚÏîÄ¿µÄ´úÂëÖУ¬¾ÓÈ»²»ÏÔʾ²éѯµÄ½á¹û¿©¡£¼ì²éÁË°ëÌ춼ûÓз¢ÏÖ´íÎóÔÚÄÄÀ×îºó²ÅÖªµÀ£¬ÓеÄACCESS¾ÓÈ»²»ÈÏʶͨŠ......
½ñÌìupdate accessÊý¾Ý¿âʱ£¬Ê¹ÓÃÁ˲ÎÊý»¯µÄ·½Ê½£¬½á¹û²»±¨´í£¬µ«ÊÇÊý¾ÝҲûÓиüС£¾¹ýgoogle·¢ÏÖaccessʹÓòÎÊý»¯Ê±£¬²ÎÊýλÖñØÐëºÍ¸³ÖµË³ÐòÏàͬ²ÅÐУ¬·ñÔò¸üÐÂʱ¾Í»á³öÏÖÊý¾ÝÎÞ·¨¸üе«ÊÇÒ²²»±¨´íµÄ¹ÖÏÖÏó¡£
ÀýÈç:update tablename set [a]=@a,[b]=@b ......
½ñÌìÔÚ×öVBÏîÄ¿µÄʱºò£¬Ê¹ÓÃÁËListBox¿Ø¼þÀ´»ñȡһЩÁбíÏÓÃÁ˲ŷ¢ÏÖûÓÐListViewºÃÓã¬ListViewÓÐItems£¨SelectItem£©¿ÉÒÔ¶¨Î»µ½µ±Ç°µÄÑ¡ÖÐÏ¶øListBoxûÓУ»ListViewÓÐTag¿ÉÒÔÉ趨ѡÖÐÏîµÄ±êʾ£¬ListBoxûÓС£ÉÏÍøÒ²ÕÒ²»µ½ÔÒò£¬ÖªµÀÈ¥ÔĶÁMSDNºÍ×Ô¼º²âÊÔ¡£
Ö®ºóÖÕÓÚÕÒµ½ÁËÎÊÌâµÄ¹Ø¼ü¡£
ʼþ1£ºÌí¼ÓListBoxÏ ......
Ç°¼¸ÈÕ£¬Óиö¸çÃÇ˵ÓкܶàµçÓ°£¬ÎÊÎÒÒª²»Òª£¿ÎÒ¾ÍÈÃËûÒ»¸öÒ»¸öµÄд¹ýÀ´£¬ÈøçÃÇÀÛ¸ö²»Çá¡£ËùÒÔ¾ÍÏë¼òµ¥Ð´¸ö³ÌÐò£¬»ñÈ¡Ò»ÏÂÎļþ¼ÐÏÂÃæµÄËùÓÐÎļþÃû³Æ£¬ÕâÑù¾Í¿ÉÒÔ½ÚÊ¡ºÜ¶àʱ¼äÁË¡£
Èí¼þÄØ£¬ÎÒÒѾÉÏ´«µ½ÍøÕ¾ÁË£ºhttp://download.csdn.net/source/1802599
vb°æ±¾Ä¿Â¼»ñÈ¡Æ÷ 1.0£¨Áú¾í·ç³öÆ·£©
˵Ã÷£º
1.Ñ¡ºÃĿ¼ºó£ ......