Access������--
ËùÊô·ÖÀࣺ ³£¼ûÎÊÌâ ×÷Õߣº ÍõÀò÷ ¸üÐÂÈÕÆÚ£º2003-10-17 19:33:08 ÔĶÁ´ÎÊý£º111

VBÖÐÀûÓÃWinrar½øÐÐÎļþѹËõ


һЩÊý¾Ý¿âÎļþ(ÈçAccessÎļþ)ÔÚÔ¶³Ì´«Êä¹ý³ÌÖпÉÄÜÓÉÓÚÎļþ±È½Ï´ó¶øÓ°Ïì´«µÝЧ¹û¡£Èç¹û½øÐÐѹËõÒÔºóÔÙ´«µÝ£¬»á¼õÉÙ´«µÝʱ¼ä£¬±ÜÃâÒâÍâµÄ·¢Éú£¬Í¬Ê±Ò²±£Ö¤ÁË´«µÝЧ¹û¡£ÎÒÃÇÔÚѹËõÎļþʱ£¬×î³£ÓõÄѹËõ¹¤¾ßΪWinRarºÍWinzip£¬±ÊÕßÔÚVB±à³Ì¹ý³ÌÖÐÀûÓÃWinRar¹¤¾ßÀ´Ñ¹ËõÊý¾Ý¿âÎļþ£¬²¢Íê³ÉÔ¶³Ì´«Ê䣬ʮ·Ö·½±ã£¬ÔÚ´ËÏò´ó¼Ò½éÉÜһϡ£ÓÃWinZipµÄ·½·¨ÀàËÆ¡£

Ò»¡¢Shellº¯Êý
¡¡¡¡Shellº¯ÊýÊÇVBÖеÄÄÚ²¿º¯Êý£¬Ëü¸ºÔðÖ´ÐÐÒ»¸ö¿ÉÖ´ÐÐÎļþ£¬·µ»ØÒ»¸öVariant(Double)£¬Èç¹û³É¹¦µÄ»°£¬´ú±íÕâ¸ö³ÌÐòµÄ½ø³ÌID£¬Èô²»³É¹¦£¬Ôò»á·µ»Ø0¡£

¡¡¡¡ShellµÄÓï·¨£ºShell(PathName[£¬WindowStyle])¡£

¡¡¡¡PathName Ϊ±ØÐè²ÎÊý¡£ÀàÐÍΪString£¬ËüÖ¸³öÁËÒªÖ´ÐеijÌÐòÃû£¬ÒÔ¼°ÈκÎÐèÒªµÄ²ÎÊý»òÃüÁîÐбäÁ¿£¬Ò²¿ÉÒÔ°üÀ¨Â·¾¶Ãû¡£

¡¡¡¡WindowStyleΪ¿ÉÑ¡²ÎÊý¡£IntegerÀàÐÍ£¬Ö¸¶¨ÔÚ³ÌÐòÔËÐÐʱ´°¿ÚµÄÑùʽ¡£WindowStyleÓÐÒÔÏÂÕâЩֵ¡£

³£Á¿ Öµ ÃèÊö
VbHide 0 ´°¿Ú±»Òþ²Ø£¬ÇÒ½¹µã»áÒƵ½Òþʽ´°¿Ú¡£
VbNormalFocus 1 ´°¿Ú¾ßÓн¹µã£¬Çһỹԭµ½ËüÔ­À´µÄ´óСºÍλÖá£
VbMinimizedFocus 2 ´°¿Ú»áÒÔÒ»¸ö¾ßÓн¹µãµÄͼ±êÀ´ÏÔʾ£¨È±Ê¡Öµ£©¡£
VbMaximizedFocus 3 ´°¿ÚÊÇÒ»¸ö¾ßÓн¹µãµÄ×î´ó»¯´°¿Ú¡£
VbNormalNoFocus 4 ´°¿Ú»á±»»¹Ô­µ½×î½üʹÓõĴóСºÍλÖ㬶øµ±Ç°»î¶¯µÄ´°¿ÚÈÔÈ»±£³Ö»î¶¯¡£
VbMinimizedNoFocus 6 ´°¿Ú»áÒÔÒ»¸öͼ±êÀ´ÏÔʾ£¬¶øµ±Ç°»î¶¯µÄ´°¿ÚÈÔÈ»±£³Ö»î¶¯¡£

¶þ¡¢¹ØÓÚWinRarµÄÓ÷¨
¡¡¡¡Ö÷Òª½éÉÜÒÔÏÂÈçºÎÔÚWinRarÖÐÓÃÃüÁîÐÐÀ´Ñ¹ËõºÍ½âѹËõÎļþ¡£

¡¡¡¡Ñ¹Ëõ£ºWINRAR A [-switches] [Files] [@File lists]

¡¡¡¡ÀýÈçÄãÏë°Ñtry.mdbѹËõµ½CÅÌÏ£¬¿ÉÒÔWINRAR A C:\try.rar C:\try.mdb

¡¡¡¡½âѹËõ£ºÈç¹û´øĿ¼½âѹËõ

¡¡¡¡¡¡¡¡¡¡¡¡WINRAR X [-switches] [Files] [@File lists] [destionation folder\]

¡¡¡¡¡¡¡¡¡¡¡¡Èç¹ûÔÚµ±Ç°Ä¿Â¼½âѹËõ£¬¼´½âѹËõʱ²»Ð´Ä¿Â¼Ãû

¡¡¡¡¡¡¡¡¡¡¡¡WINRAR E [-switches] [Files] [@File lists] [destionation folder\]

¡¡¡¡ÀýÈçÄãÏë°Ñtry.rar½âѹËõµ½CÅÌÏ£¬¿ÉÒÔWINRAR X C:\try.rar C:\try.mdb

Èý¡¢Ò»¸öÀý×Ó
¡¡¡¡ÔÚVBÖÐн¨Ò»¸ö¹¤³Ì£¬ÔÚForm1ÖÐÌí¼ÓÁ½¸ö°´Å¥Command1¡¢Command2ºÍCommand3£¬°ÑËûÃǵÄCaptionÊôÐÔ·Ö±ðÉèΪ"ѹËõÎļþ"¡¢"½âѹËõÎļþ"ºÍ"´«µÝÎļþ"¡£°´Command1ʱ°ÑÎļþtry.mdbѹËõ³Étry.rar¡£

¡¡¡¡Private Sub Command1_Click()

¡¡¡¡Dim Rarexe As String WINRARÖ´ÐÐÎļþµÄλÖÃ

¡¡¡¡Dim Source As String ѹËõÇ°µÄԭʼÎļþ

¡¡¡¡Dim Target As String ѹËõºóµÄÄ¿±êÎļþ

¡¡¡¡Dim FileString as String ShellÖ¸ÁîÖеÄ×Ö·û´®

¡¡¡¡Dim Result As Long

¡¡¡¡¡¡¡¡Rarexe="C:\program files\winrar\winrar"

¡¡¡¡Source="C:\try.mdb"

¡¡¡¡Target="C:\try.rar"

¡¡¡¡FileString = rarexe & " a " & Target & " " & Source

¡¡¡¡Result = Shell(FileString, vbHide)

¡¡¡¡End Sub

¡¡¡¡½âѹµÄ¹ý³ÌÀàËÆ£¬°´Command2¿ÉÒÔ°Ñtry.rar½âѹÉú³É try.mdb¡£ÔÚÖ´ÐÐÁËÉÏÃæµÄѹËõ¹ý³Ìºó£¬¿ÉÒÔɾ³ýÎļþtry.mdb£¬À´½âѹËõÖØÐÂÉú³Étry.mdb¡£

¡¡¡¡Private Sub Command2_Click()

¡¡¡¡Dim Rarexe As String WINRARÖ´ÐÐÎļþµÄλÖÃ

¡¡¡¡Dim Source As String ½âѹËõÇ°µÄԭʼÎļþ

¡¡¡¡Dim Target As String ½âѹËõºóµÄÄ¿±êÎļþ

¡¡¡¡Dim FileString as String ShellÖ¸ÁîÖеÄ×Ö·û´®

¡¡¡¡Dim Result As Long

¡¡¡¡¡¡¡¡Rarexe="C:\program files\winrar\winrar"

¡¡¡¡Source="C:\try.rar"

¡¡¡¡Target="C:\try.mdb"

¡¡¡¡FileString = rarexe & " X " & Source & " " & Target

¡¡¡¡Result = Shell(FileString, vbHide)

¡¡¡¡End Sub

¡¡¡¡Îļþ´Óһ̨¼ÆËã»ú´«Êäµ½Áíһ̨¼ÆËã»úÇ°£¬Ó¦ÖªµÀÁíһ̨¼ÆËã»úµÄÃû×Ö£¬È»ºóÓÃFileCopyÓï¾ä¾Í¿ÉÒÔÁË¡£¼ÙÉèÒª°ÑѹËõºótry.rar´«µÝµ½¼ÆËã»úÃûΪ"other"µÄ¹²ïíĿ¼"want"Ï¡£

¡¡¡¡Private Sub Command3_Click()

¡¡¡¡Dim SourceFile, DestinationFile

¡¡¡¡ SourceFile ="C:\try.rar " Ö¸¶¨Ô´ÎļþÃû¡£

¡¡¡¡ DestinationFile = "\\other\want\try.rar" Ö¸¶¨Ä¿µÄÎļþÃû¡£

¡¡¡¡ FileCopy SourceFile, DestinationFile ½«Ô´ÎļþµÄÄÚÈݸ´ÖƵ½Ä¿µÄÎļþÖС£

¡¡¡¡End Sub

¡¡¡¡ÔõôÑù£¬Ê®·Ö¼òµ¥°É£¿


--------------------------------------------------------------------------------
Ïà¹ØÎÄÕÂ

Á½¸öδ¹«¿ªµÄACCESS·½·¨µÄʹÓü¼ÇÉ 2003-12-30 14:59:33
Á˽â Microsoft Access °²È«ÐÔ 2003-11-13 11:21:08
Èÿؼþ×ÔÊÊÓ¦ÆÁÄ»·Ö±æÂÊ 2003-10-18 9:58:33
MS Jet SQL for Access 2000Öм¶Æª (II) 2003-10-17 18:51:01
ÈçºÎÕï¶Ï/ÐÞ¸´Ëð»µµÄ Jet 4.0 Êý¾Ý¿â 2003-10-14 8:31:26
AccessÆô¶¯ÃüÁîÐÐÑ¡Ïî´óÈ« 2003-10-10 10:02:00
ÓÅ»¯Microsoft AccessÌá¸ßËÙ¶È 2003-10-6 10:31:55


ϵͳÓÅ»¯
¿Ø¼þʹÓÃ
Êý¾Ý¿âÉè¼Æ
Êý¾Ý¿âÁ¬½Ó
ϵͳ°²È«
OLE×Ô¶¯»¯
³£¼ûÎÊÌâ
ʵÓôúÂë
ÊôÐÔÏê½â
ÍøÂçÏà¹Ø
ʵÓÃAPI
¾­Ñé·ÖÏí
¾«Ñ¡½Ì³Ì
×Ö·û´¦Àí
ADPÏà¹Ø



ÎÄÕÂËÑË÷



ÖÆ×÷ά»¤£ºÀîÑ°»¶     Mail:[email protected]

¹ØÓÚ±¾Õ¾ -- ÍøÕ¾·þÎñ -- °æȨÌõ¿î -- ÁªÏµ·½·¨ -- ÍøÕ¾°ïÖú
Access°®ºÃÕß°æȨËùÓÐ Copyright 2003-2005 All Rights Reserved δ¾­Ðí¿É²»µÃµÁÁ´