Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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 +


Ïà¹ØÎĵµ£º

ʲôÊÇAccessÊý¾Ý¿â

 Microsoft AccessÊÇÒ»ÖÖ¹ØϵʽÊý¾Ý¿â£¬¹ØϵʽÊý¾Ý¿âÓÉһϵÁбí×é³É£¬±íÓÖÓÉһϵÁÐÐкÍÁÐ×é³É£¬Ã¿Ò»ÐÐÊÇÒ»¸ö¼Ç¼£¬Ã¿Ò»ÁÐÊÇÒ»¸ö×ֶΣ¬Ã¿¸ö×Ö¶ÎÓÐÒ»¸ö×Ö¶ÎÃû£¬×Ö¶ÎÃûÔÚÒ»¸ö±íÖв»ÄÜÖظ´¡£ ¡¡¡¡
±íÓë±íÖ®¼ä¿ÉÒÔ½¨Á¢¹Øϵ£¨»ò³Æ¹ØÁª£¬Á¬½Ó£©£¬ÒÔ±ã²éѯÏà¹ØÁªµÄÐÅÏ¢¡£AccessÊý¾Ý¿âÒÔÎļþÐÎʽ±£´æ£¬ÎļþµÄÀ©Õ¹ÃûMDB¡£ ¡¡¡¡ ......

ºÜÍ·ÌÛµÄACCESS²éѯÎÊÌ⣡

ÔÚACCESS(2007)Êý¾Ý¿âÖУ¬ÓÐÕâÑùÒ»¸öÄ£ºý²éѯ£¬ 
select postId,postName,postType,left(postTime,10) as postTimes from PostInfo where postUser like '*ÖÜ·¼*'
ÔÚÊý¾Ý¿â²éѯºó½á¹ûÏÔʾÕýÈ·£¬¿ÉÊÇ·ÅÔÚÏîÄ¿µÄ´úÂëÖУ¬¾ÓÈ»²»ÏÔʾ²éѯµÄ½á¹û¿©¡£¼ì²éÁË°ëÌ춼ûÓз¢ÏÖ´íÎóÔÚÄÄÀ×îºó²ÅÖªµÀ£¬ÓеÄACCESS¾ÓÈ»²»ÈÏʶͨŠ......

AccessʹÓòÎÊý»¯UPDATEÊý¾Ýʱ£¬Êý¾ÝÎÞ·¨¸üеÄÎÊÌâ

      ½ñÌìupdate accessÊý¾Ý¿âʱ£¬Ê¹ÓÃÁ˲ÎÊý»¯µÄ·½Ê½£¬½á¹û²»±¨´í£¬µ«ÊÇÊý¾ÝҲûÓиüС£¾­¹ýgoogle·¢ÏÖaccessʹÓòÎÊý»¯Ê±£¬²ÎÊýλÖñØÐëºÍ¸³ÖµË³ÐòÏàͬ²ÅÐУ¬·ñÔò¸üÐÂʱ¾Í»á³öÏÖÊý¾ÝÎÞ·¨¸üе«ÊÇÒ²²»±¨´íµÄ¹ÖÏÖÏó¡£
      ÀýÈç:update tablename set [a]=@a,[b]=@b ......

¹ØÓÚVBµÄListBox¿Ø¼þÑ¡¶¨ÏîµÄ»ñÈ¡

 ½ñÌìÔÚ×öVBÏîÄ¿µÄʱºò£¬Ê¹ÓÃÁËListBox¿Ø¼þÀ´»ñȡһЩÁбíÏÓÃÁ˲ŷ¢ÏÖûÓÐListViewºÃÓã¬ListViewÓÐItems£¨SelectItem£©¿ÉÒÔ¶¨Î»µ½µ±Ç°µÄÑ¡ÖÐÏ¶øListBoxûÓУ»ListViewÓÐTag¿ÉÒÔÉ趨ѡÖÐÏîµÄ±êʾ£¬ListBoxûÓС£ÉÏÍøÒ²ÕÒ²»µ½Ô­Òò£¬ÖªµÀÈ¥ÔĶÁMSDNºÍ×Ô¼º²âÊÔ¡£
Ö®ºóÖÕÓÚÕÒµ½ÁËÎÊÌâµÄ¹Ø¼ü¡£
ʼþ1£ºÌí¼ÓListBoxÏ ......

vbʵÏÖĿ¼ÏÂËùÓÐÎļþÃûĿ¼Ãû³ÆµÄ»ñÈ¡

 Ç°¼¸ÈÕ£¬Óиö¸çÃÇ˵ÓкܶàµçÓ°£¬ÎÊÎÒÒª²»Òª£¿ÎÒ¾ÍÈÃËûÒ»¸öÒ»¸öµÄд¹ýÀ´£¬ÈøçÃÇÀÛ¸ö²»Çá¡£ËùÒÔ¾ÍÏë¼òµ¥Ð´¸ö³ÌÐò£¬»ñÈ¡Ò»ÏÂÎļþ¼ÐÏÂÃæµÄËùÓÐÎļþÃû³Æ£¬ÕâÑù¾Í¿ÉÒÔ½ÚÊ¡ºÜ¶àʱ¼äÁË¡£
Èí¼þÄØ£¬ÎÒÒѾ­ÉÏ´«µ½ÍøÕ¾ÁË£ºhttp://download.csdn.net/source/1802599
vb°æ±¾Ä¿Â¼»ñÈ¡Æ÷ 1.0£¨Áú¾í·ç³öÆ·£©
˵Ã÷£º
1.Ñ¡ºÃĿ¼ºó£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ