Access������--
ËùÊô·ÖÀࣺ ϵͳ°²È« ×÷Õߣº ¹²ïí ¸üÐÂÈÕÆÚ£º2003-11-13 11:21:08 ÔĶÁ´ÎÊý£º895

Á˽â Microsoft Access °²È«ÐÔ


¼ò½é
ÔÚÔçÆÚ°æ±¾µÄ Microsoft? Access£¨Microsoft Access 2000 ÒÔÇ°£©ÖУ¬Óйذ²È«ÐÔµÄ֪ʶÓÐʱ±»ÈÏΪÊÇÎÞ·¨ÎªÈκÎÈËËùÕÆÎÕºÍÓ¦Óõġ£ÄúÐèÒª°´Ë³ÐòÖ´ÐкܶಽÖ裬һµ©ÒÅ©ij¸ö²½Öè»òÕߵߵ¹ÁË˳Ðò¾Í»á´øÀ´ÔÖÄÑÐԵĺó¹û¡£Ëæ×Å Microsoft Access for Microsoft Windows? 95 µÄ Security Wizard ³öÏÖ£¬ÒÔ¼° Microsoft Access 2000 µÄ Security Wizard µÄ²»¶Ï¸Ä½ø£¬ÔÚ Access ÖÐʵÏÖ°²È«ÐÔÒѱäµÃ·Ç³£¼òµ¥¡£µ«ÊÇ£¬¼´Ê¹ÓÐÁËÕâЩ°ïÖú£¬ÄúÒ²±ØÐëÇå³þ×Ô¼ºµÄ°²È«Ñ¡Ï²¢ÕÆÎÕÔÚÊý¾Ý¿âÖб£»¤Êý¾ÝºÍ¶ÔÏóµÄ²Ù×÷¡£·ñÔò£¬ÇáÕß»á´øÀ´Êý¾Ý°²È«Òþ»¼£¬ÖØÕ߻ὫÄúËøÔÚ×Ô¼ºµÄÊý¾Ý¿âÖ®Íâ¡£

Óкܶ෽·¨¿ÉÒÔ±£»¤ÄúµÄ Access Êý¾Ý¿âÒÔ¼°ÆäÖаüº¬µÄÊý¾Ý¡£ÔÚ±¾ÎÄÖУ¬ÎÒÃǽ«ÌÖÂÛÓÃÓÚ±£»¤×é³ÉÊý¾Ý¿âµÄ¸÷¸ö¶ÔÏ󣨰üº¬Êý¾Ý£©¡¢°üº¬ÖîÈç´°ÌåºÍ±¨±íµÈÔªËصĶÔÏóÒÔ¼°´úÂ루¿ÉÄÜÊÇÊý¾Ý¿âÖÐ×îÓмÛÖµµÄ²¿·Ö£©µÄ·½·¨¡£±¾ÎÄÖÐÌÖÂ۵ݲȫ¼¼ÇÉÖ»ÊÊÓÃÓÚ Microsoft Access Êý¾Ý¿â (.mdb) Îļþ¡£

ÐèÒªÁ˽âµÄÓйر£»¤Ãô¸ÐÊý¾ÝµÄ֪ʶ
ÄúÓ¦¸ÃÖªµÀ£¬Óкܶ๤¾ßºÍµÚÈý·½ÊµÓóÌÐò¿ÉÒÔÓÃÓÚ̽²âÈκÎÀàÐ͵ÄÊý¾Ý¿âµÄÃÜÂ룬ÒÔ¼°À´×ÔÈκι¤×÷×éÐÅÏ¢ÎļþµÄÓû§ÃûºÍÃÜÂ루±¾ÎĺóÃ潫Ïêϸ½éÉܹ¤×÷×éÐÅÏ¢Îļþ£©¡£Èç¹ûÐèÒª±£»¤Ãô¸ÐÊý¾ÝÃâÊÜ·Ç·¨·ÃÎÊ£¬×îºÃµÄ°²È«´ëÊ©¾ÍÊÇʹÓüÆËã»ú²Ù×÷ϵͳÌṩµÄÎļþ¼¶°²È«ÐÔºÍÎļþ¹²ïí°²È«ÐÔ¡£Îļþ¼¶°²È«ÐÔÉæ¼°ÔÚÊý¾ÝÎļþÉÏÉèÖÃȨÏÞ¡£Îļþ¹²ïí°²È«ÐÔÉæ¼°ÏÞÖƶÔÊý¾ÝÎļþ´æ´¢Î»ÖõķÃÎÊ¡£Îļþ¹²ïí°²È«ÐÔµÄÒ»¸öʾÀýÊÇÔÚ´æ´¢Êý¾ÝÎļþµÄÎļþ¼Ð£¨Î»ÓÚ±¾µØ¼ÆËã»ú»òÍøÂç·þÎñÆ÷ÉÏ£©ÉÏÉèÖÃÓû§È¨ÏÞ¡£Îª´Ë£¬¿ÉÒÔ½«Êý¾Ý²ð·Öµ½¶à¸öÎļþÖУ¬ÔÚÕâЩÎļþÉÏÉèÖÃÓû§È¨ÏÞ£¬ÔÙ½«ÕâЩÎļþ·ÅÖõ½Êܱ£»¤µÄÎļþ¹²ïí¿Õ¼äÖС£È»ºó¿ÉÒÔ´Ó¾ßÓа²È«ÉèÖÃµÄ Access Êý¾Ý¿âÁ´½Óµ½ÕâЩÎļþ¡£

Access °²È«ÐÔ¸ÅÊö
ÒÔϸ÷½Ú½éÉÜÁ˼¸ÖÖ±£»¤ Access Êý¾Ý¿âµÄ·½·¨¡£

¼ÓÃÜ»ò½âÃÜÊý¾Ý¿â
×î¼òµ¥£¨Ò²ÊÇ°²È«ÐÔ×îµÍ£©µÄ±£»¤·½·¨ÊǶÔÊý¾Ý¿â½øÐмÓÃÜ¡£¼ÓÃÜÊý¾Ý¿â¾ÍÊǽ«Êý¾Ý¿âÎļþѹËõ£¬´Ó¶øʹijЩʵÓóÌÐò£¨Èç×Ö´¦ÀíÆ÷£©²»Äܽâ¶ÁÕâЩÎļþ¡£¼ÓÃÜÒ»¸ö²»¾ßÓа²È«ÉèÖõÄÊý¾Ý¿â²¢²»Äܱ£Ö¤Êý¾Ý¿âµÄ°²È«£¬ÒòΪÈκÎÈ˶¼¿ÉÒÔ´ò¿ªÊý¾Ý¿â²¢ÍêÈ«·ÃÎÊÊý¾Ý¿âÖеÄËùÓжÔÏó¡£ÓйضÔÊý¾Ý¿â½øÐа²È«ÉèÖõÄÏêϸÄÚÈÝ£¬Çë²ÎÔı¾ÎĺóÃæµÄʹÓà Security Wizard ÉèÖà Access Êý¾Ý¿âµÄ°²È«ÐÔ¡£

¼ÓÃÜ¿ÉÒÔ±ÜÃâÔÚÒÔµç×Ó·½Ê½´«ÊäÊý¾Ý¿â»òÕß½«Æä´æ´¢ÔÚÈíÅÌ¡¢´Å´ø»ò¹âÅÌÉÏʱ£¬ÆäËûÓû§Å¼È»·ÃÎÊÊý¾Ý¿âÖеÄÐÅÏ¢¡£È»¶ø Jet£¨Access ʹÓõÄÊý¾Ý¿âÒýÇ棩ʹÓõļÓÃÜ·½·¨·Ç³£±¡Èõ£¬Òò´Ë¾ø²»ÄÜÓÃÓÚ±£»¤Ãô¸ÐÊý¾Ý¡£¡°¼ÓÃÜ/½âÃÜÊý¾Ý¿â¡±ÃüÁîλÓÚ¡°¹¤¾ß¡±²Ëµ¥µÄ¡°°²È«¡±×Ӳ˵¥ÖС£½âÃÜÊý¾Ý¿âÊǶԼÓÃܹý³ÌµÄÄæÔËËã¡£

ʹÓÃ×Ô¶¨Òå½çÃæ
ÁíÒ»ÖÖÏà¶Ô¼òµ¥µÄ±£»¤·½°¸ÊÇʹÓÃ×Ô¶¨Òå½çÃæ´úÌæ Access ±ê×¼½çÃæ¡£Óë¼ÓÃÜÒ»Ñù£¬ËüÒ²²»Äܱ£»¤Êý¾Ý¿âÖеĶÔÏóºÍÃô¸ÐÊý¾ÝµÄ°²È«¡£Í¨¹ýÑ¡Ôñ¡°¹¤¾ß¡±²Ëµ¥Öеġ°Æô¶¯¡±Ñ¡ÏÄú¿ÉÒÔÖ¸¶¨×Ô¶¨ÒåµÄÆô¶¯´°Ìå¡¢²Ëµ¥£¬ÉõÖÁ×Ô¶¨ÒåµÄ±êÌâºÍͼ±ê¡£»¹¿ÉÒÔÑ¡ÔñÈ¡Ïû Database ´°¿Ú£¬´Ó¶ø¶Ôȱ·¦ÏàÓ¦¼¼ÊõµÄÓ¦ÓóÌÐòÓû§Òþ²ØÕâЩ¶ÔÏ󡣡°Æô¶¯¡±¶Ô»°¿òµÄ¸÷ÏÄÜÒ²¿ÉÒÔͨ¹ý±à³ÌʵÏÖ¡£ÓйØÈçºÎ´Ó¡°Æô¶¯¡±¶Ô»°¿òÉèÖÃÆô¶¯Ñ¡ÏîµÄÏêϸÐÅÏ¢£¬Çë²ÎÔÄ Access °ïÖúÖеġ°¹ØÓÚÆô¶¯Ñ¡Ï¡£ÓйØÈçºÎͨ¹ý±à³ÌÉèÖÃÆô¶¯Ñ¡ÏîµÄÏêϸÐÅÏ¢£¬Çë²ÎÔÄ Access °ïÖú Microsoft Visual Basic? ±à¼­Æ÷µÄ¡°ÉèÖá®Æô¶¯¡¯Ñ¡ÏîºÍ±àÂëÖеÄÑ¡Ï¡£

ÉèÖÃÊý¾Ý¿âÃÜÂë
Äú¿ÉÒÔÔÚÊý¾Ý¿âÉÏÉèÖÃÃÜÂ룬´Ó¶øÒªÇóÓû§ÔÚ·ÃÎÊÊý¾ÝºÍÊý¾Ý¿â¶ÔÏóʱÊäÈëÃÜÂë¡£

×¢Ò⣺ʹÓÃÃÜÂë±£»¤Êý¾Ý¿â»òÆäÖеĶÔÏóµÄ°²È«ÐÔÒ²³ÆΪ¹²ïí¼¶°²È«ÐÔ¡£
Äú²»ÄÜʹÓôËÑ¡ÏîΪÓû§»ò×é·ÖÅäȨÏÞ£¬Òò´ËÈκÎÕÆÎÕÃÜÂëµÄÈ˶¼¿ÉÒÔÎÞÏÞÖƵطÃÎÊËùÓÐ Access Êý¾ÝºÍÊý¾Ý¿â¶ÔÏ󡣡°ÉèÖÃÊý¾Ý¿âÃÜÂ롱ÃüÁîλÓÚ¡°¹¤¾ß¡±²Ëµ¥µÄ¡°°²È«¡±×Ӳ˵¥ÖС£

Óû§¼¶°²È«ÐÔ
³ý¹²ïí¼¶°²È«ÐÔÍ⣬Äú»¹¿ÉÒÔʹÓÃÓû§¼¶°²È«ÐÔ£¬ËüÌṩÁË×îÑϸñµÄ·ÃÎÊÏÞÖÆ£¬Ê¹ÄúÄܹ»×î´óÏ޶ȵؿØÖÆÊý¾Ý¿â¼°ÆäÖаüº¬µÄ¶ÔÏó¡£ÕâÊÇÎÒÃÇËùÍƼöµÄÊý¾Ý¿â±£»¤´ëÊ©µÄÒ»²¿·Ö£¨µ±ºÍ²Ù×÷ϵͳÌṩµÄÎļþ¼¶ºÍ¹²ïí¼¶°²È«ÐÔ½áºÏʹÓÃʱ£©£¬Òò´ËÎÒÃǽ«ÔÚ±¾ÎĺóÃæ¶ÔÓû§¼¶°²È«ÐÔ×öÏêϸ½éÉÜ¡£

ͬÑù£¬ÎÒÃÇÒ²½«ÌÖÂÛÓÃÓÚ±£»¤Êý¾Ý¿âÖаüº¬µÄ Visual Basic for Applications (VBA) ´úÂëµÄ¸÷ÖÖ·½·¨¡£

¾¯¸æ£ºÓû§¼¶°²È«ÐÔ£¨ÔÚµ¥¶ÀʹÓÃʱ£©Ö÷ÒªÓÃÓÚ±£»¤Êý¾Ý¿âÖеĴúÂëºÍ¶ÔÏó£¬ÒÔÃâÓû§²»Ð¡ÐĽøÐÐÁËÐ޸Ļò¸ü¸Ä¡£Èç¹û²»Ï£ÍûÓû§·Ç·¨·ÃÎÊ´°Ìå¡¢±¨±í»òÄ£¿éÖеĴúÂ룬Ôò±ØÐ뽫 .mdb Îļþת»»Îª MDE Îļþ£¨±¾ÎĺóÃ潫Ïêϸ½éÉÜ£©¡£Òª±ÜÃâÓû§ÐÞ¸ÄÊý¾Ý¿âÖеIJéѯ¡¢ºê»òÊý¾Ý·ÃÎÊÒ³£¬Î¨Ò»µÄ·½·¨¾ÍÊǽ«Êý¾Ý¿âÎļþ·ÅÔÚÒ»¸öÊܱ£»¤µÄÎļþ¹²ïíÇøÓòÖС£´ËÍ⣬ÔÚ Access Öв»¿ÉÄܼÈÔÊÐíÓû§Ð޸ıíÖеÄÊý¾Ý£¬Í¬Ê±ÓÖ½ûÖ¹ÆäÐ޸ıíµÄÉè¼Æ»òɾ³ý±í¡£ÒªÌṩÕâÑùÒ»ÖÖ¹¦ÄÜ£¬ÐèҪʹÓÃÒ»¸ö»ùÓÚ·þÎñÆ÷µÄÊý¾Ý¿â²úÆ·£¬ÀýÈç Microsoft SQL Server?¡£
ÉèÖÃÄ£¿éÃÜÂë
ʹÓÃÃÜÂë¿ÉÒÔ±£»¤ËùÓбê׼ģ¿éºÍÀàÄ£¿é£¨ÀýÈç´°ÌåºÍ±¨±íÖаüº¬µÄ´úÂ룩ÒÔÃâÓû§²»Ð¡ÐÄÐ޸Ļò²é¿´ VBA ´úÂë¡£ÉèÖÃÃÜÂëºó£¬ÄúÖ»ÐèÔÚÿ´Î»á»°Ê±ÊäÈëÒ»´ÎÃÜÂ룬ÒÔ±ãÔÚ Visual Basic ±à¼­Æ÷Öв鿴»òÐ޸ĴúÂë¡£³ý²é¿´ºÍ±à¼­Í⣬ÔÚ¼ôÇС¢¸´ÖÆ¡¢Õ³Ìù¡¢µ¼³ö»òɾ³ýÈκÎÄ£¿éʱҲ¶¼ÐèÒªÃÜÂë¡£µ«Ó¦¸ÃÇå³þµÄÊÇ£¬Ê¹ÓÃÕâÖÖ·½·¨±£»¤´úÂë²»ÄÜ·ÀÖ¹Äú»òÆäËûÓû§ÔËÐдúÂ룬Ҳ²»ÄÜ·ÀÖ¹ÆäËûÓû§Ê¹ÓõÚÈý·½ÊµÓóÌÐò£¨Èç 16 ½øÖƱ༭Æ÷£©À´²é¿´´úÂë¡£ÒªÍêÈ«±£»¤´úÂ룬±ØÐ뽫 .mdb Îļþת»»Îª MDE Îļþ¡£

ҪΪÏîÄ¿ÖеÄÄ£¿éÉèÖÃÃÜÂ룺

Ϊ¸ÃÏîÄ¿´Ó Visual Basic ±à¼­Æ÷µÄ¡°¹¤¾ß¡±²Ëµ¥ÖÐÑ¡Ôñ¡°ÊôÐÔ¡±ÃüÁî¡£
ÔÚ¡°ÏîÄ¿ÊôÐÔ¡±¶Ô»°¿òÖУ¬µ¥»÷¡°±£»¤¡±Ñ¡Ï¡£
Ñ¡ÖС°²é¿´Ê±Ëø¶¨¹¤³Ì¡±¸´Ñ¡¿ò²¢¼üÈëÃÜÂë¡£
ÔÚ¡°È·ÈÏÃÜÂ롱¿òÖУ¬ÖØмüÈëÃÜÂ룬Ȼºóµ¥»÷¡°È·¶¨¡±¡£
ʹÓà MDE Îļþ
ͨ¹ý½«Êý¾Ý¿âÎļþת»»Îª MDE Îļþ£¬¿ÉÒÔÍêÈ«±£»¤ Access ÖеĴúÂëÃâÊÜ·Ç·¨·ÃÎÊ¡£½« .mdb Îļþת»»Îª MDE Îļþʱ£¬Access ½«±àÒëËùÓÐÄ£¿é£¬É¾³ýËùÓпɱ༭µÄÔ´´úÂ룬ȻºóѹËõÄ¿±êÊý¾Ý¿â¡£Ô­Ê¼µÄ .mdb Îļþ²»»áÊܵ½Ó°Ïì¡£ÐÂÊý¾Ý¿âÖÐµÄ VBA ´úÂëÈÔÈ»ÄÜÔËÐУ¬µ«²»Äܲ鿴»ò±à¼­¡£Êý¾Ý¿â½«¼ÌÐøÕý³£¹¤×÷£¬ÄúÈÔÈ»¿ÉÒÔÉý¼¶Êý¾ÝºÍÔËÐб¨±í¡£ÓÈÆäÊÇ£¬½« Access Êý¾Ý¿â±£´æΪ MDE Îļþ¿ÉÒÔ·ÀÖ¹ÒÔϲÙ×÷£º

ÔÚÉè¼ÆÊÓͼÖв鿴¡¢Ð޸Ļò´´½¨´°Ìå¡¢±¨±í»òÄ£¿é¡£
Ìí¼Ó¡¢É¾³ý»ò¸ü¸Ä¶Ô¶ÔÏó¿â»òÊý¾Ý¿âµÄÒýÓá£
ʹÓà Access »ò VBA ¶ÔÏóÄ£Ð͵ÄÊôÐÔ»ò·½·¨¸ü¸Ä´úÂë - MDE Îļþ²»°üº¬¿É±à¼­´úÂë¡£
µ¼Èë»òµ¼³ö´°Ìå¡¢±¨±í»òÄ£¿é¡£¶ø±í¡¢²éѯ¡¢Êý¾Ý·ÃÎÊÒ³ºÍºê¿ÉÒÔµ¼Èë·Ç MDE Êý¾Ý¿â£¬»ò´ÓÖе¼³ö¡£
Òª½« .mdb Îļþת»»Îª MDE Îļþ£º

¹Ø±ÕÊý¾Ý¿â¡£
µ¥»÷¡°¹¤¾ß¡±²Ëµ¥Öеġ°Êý¾Ý¿âʵÓù¤¾ß¡±¡£
µ¥»÷¡°Éú³É MDE Îļþ¡±¡£
ÔÚ¡°±£´æÊý¾Ý¿âΪ MDE¡±¶Ô»°¿òÖУ¬ÕÒµ½ .mdb Îļþ£¬È»ºóµ¥»÷¡°Éú³É MDE¡±¡£
×¢Ò⣺ÔÚ Access 2002 Öд´½¨µÄÊý¾Ý¿âʹÓÃĬÈ쵀 Access 2000 Îļþ¸ñʽ¡£Access 2000 Îļþ¸ñʽµÄÊý¾Ý¿âÖ»ÄÜÔÚ Access 2000 ÖÐת»»Îª MDE ¸ñʽ¡£ÒªÔÚ Access 2002 Öн«ÒÔĬÈ쵀 Access 2000 ¸ñʽ´´½¨µÄ .mdb Îļþת»»Îª MDE Îļþ£¬±ØÐëÏȽ«Îļþת»»Îª Access 2002 Îļþ¸ñʽ¡£Îª´Ë£¬¿ÉÒÔÊ×ÏÈÒÔ¶ÀÕ¼·½Ê½´ò¿ªÊý¾Ý¿â£¨ÒªÒÔ¶ÀÕ¼·½Ê½´ò¿ªÊý¾Ý¿â£¬Çë²ÎÔı¾ÎĺóÃæµÄÊÖ¶¯ÉèÖÃÊý¾Ý¿âÃÜÂëÒ»½Ú)¡£½ÓÏÂÀ´£¬Ö¸Ïò¡°¹¤¾ß¡±²Ëµ¥Öеġ°Êý¾Ý¿âʵÓù¤¾ß¡±£¬Ö¸Ïò¡°×ª»»Êý¾Ý¿â¡±£¬È»ºóµ¥»÷¡°×ªÎª Access 2002 Îļþ¸ñʽ¡±¡£Êý¾Ý¿â¼´¿Éת»»Îª MDE Îļþ¡£
Óйؽ« .mdb Îļþת»»Îª MDE ÎļþµÄ¸ü¶àÒªÇó£¬Çë²ÎÔÄ Access °ïÖúÖеġ°±£»¤ Access Êý¾Ý¿âÖÐµÄ Visual Basic for Applications ´úÂ롱¡£

ÏÂÃæÎÒÃÇÀ´¿´¿´Óû§¼¶°²È«ÐÔ¡£

¹ØÓÚ Access Óû§¼¶°²È«ÐÔ
Access ʹÓà Microsoft Jet Êý¾Ý¿âÒýÇæÀ´´æ´¢ºÍ¼ìË÷Êý¾Ý¿âÖеĶÔÏó¡£Jet Êý¾Ý¿âÒýÇæʹÓûùÓÚ¹¤×÷×éµÄ°²È«Ä£ÐÍ£¨Ò²³ÆΪÓû§¼¶°²È«ÐÔ£©À´ÅжÏË­¿ÉÒÔ´ò¿ªÊý¾Ý¿â£¬²¢±£»¤Êý¾Ý¿âËù°üº¬¶ÔÏóµÄ°²È«¡£ÎÞÂÛÊÇ·ñÃ÷È·ÉèÖÃÁËÊý¾Ý¿âµÄ°²È«ÐÔ£¬Óû§¼¶°²È«ÐÔ¶ÔËùÓÐ Access Êý¾Ý¿âʼÖÕ´¦ÓÚ´ò¿ª×´Ì¬¡£Äú¿ÉÒÔͨ¹ý²Ù×ÝÓû§ºÍ×éÕÊ»§µÄȨÏ޺ͳÉÔ±Éí·ÝÀ´¸ü¸Ä Access ÖеÄĬÈÏ°²È«¼¶±ð¡£ÏÂÃ潫¶Ô´Ë½øÐнéÉÜ¡£

ÎÞÂÛºÎʱÆô¶¯ Access£¬Jet Êý¾Ý¿âÒýÇ涼Ҫ²éÕÒ¹¤×÷×éÐÅÏ¢Îļþ£¨Ä¬ÈÏÃû³ÆΪ system.mdw£¬Ò²¿ÉÒÔʹÓÃÀ©Õ¹Ãû .mdw ÈÎÒâÃüÃû£©¡£¹¤×÷×éÐÅÏ¢Îļþ°üº¬×éºÍÓû§ÐÅÏ¢£¨°üÀ¨ÃÜÂ룩£¬ÕâЩÐÅÏ¢¾ö¶¨ÁËË­¿ÉÒÔ´ò¿ªÊý¾Ý¿â£¬ÒÔ¼°ËûÃǶÔÊý¾Ý¿âÖеĶÔÏóµÄȨÏÞ¡£¶Ôµ¥¸ö¶ÔÏóµÄȨÏÞ´æ´¢ÔÚÊý¾Ý¿âÖС£ÕâÑù£¬ÀýÈ磬¾Í¿ÉÒÔ¸³ÓèÒ»¸ö×éµÄÓû§£¨¶ø²»ÊÇÆäËûÓû§£©Ê¹ÓÃÌض¨±íµÄȨÏÞ£¬¶ø¸³ÓèÁíÒ»¸ö×é²é¿´±¨±íµÄȨÏÞ£¬µ«²»ÄÜÐ޸ı¨±íµÄÉè¼Æ¡£

¹¤×÷×éÐÅÏ¢Îļþ°üÀ¨ÄÚÖÃ×飨Admins ºÍ Users£©ÒÔ¼°Ò»¸öͨÓÃÓû§ÕÊ»§ (Admin)£¬¸ÃÕÊ»§¾ßÓйÜÀíÊý¾Ý¿â¼°Æä°üº¬µÄ¶ÔÏóµÄȨÏÞ£¨ÎÞÏÞÖÆ£©¡£ÄúÒ²¿ÉÒÔʹÓò˵¥ÃüÁ¡°¹¤¾ß¡±²Ëµ¥Öеġ°°²È«¡±×Ӳ˵¥£©»òÕßͨ¹ý VBA ´úÂëÌí¼ÓеÄ×éºÍÓû§¡£

×¢Ò⣺°²×° Access ʱ£¬°²×°³ÌÐò»á×Ô¶¯´´½¨¹¤×÷×éÐÅÏ¢Îļþ£¬²¢Ê¹ÓÃÄúÖ¸¶¨µÄÃû³ÆºÍµ¥Î»ÐÅÏ¢À´ÃüÃû¡£ÒòΪÕâÒ»ÐÅϢͨ³£ºÜÈÝÒ×±»ÅжϳöÀ´£¬Òò¶øδ¾­ÊÚȨµÄÓû§ºÜ¿ÉÄܻᴴ½¨ÁíÒ»¸ö°æ±¾µÄ¹¤×÷×éÐÅÏ¢Îļþ£¬´Ó¶øÔÚÓɸù¤×÷×éÐÅÏ¢Îļþ¶¨ÒåµÄ¹¤×÷×éÖУ¬Îª×Ô¼ºÉ趨һ¸ö²»¿É³·ÏûµÄ¹ÜÀíÔ±ÕÊ»§£¨Admins ×éµÄ³ÉÔ±£©È¨ÏÞ¡£Îª·ÀÖ¹·¢ÉúÕâÖÖÇé¿ö£¬Ó¦´´½¨Ò»¸öÐµĹ¤×÷×éÐÅÏ¢Îļþ£¬²¢Ö¸¶¨Î¨Ò»µÄ¹¤×÷×é ID (WID)¡£ÕâÑù£¬Ö»ÓÐÖªµÀ WID µÄÓû§²ÅÄÜ´´½¨¸Ã¹¤×÷×éÐÅÏ¢ÎļþµÄ¸±±¾¡£±¾ÎĺóÃ潫ÌÖÂÛʹÓà User-level Security Wizard ´´½¨ÐµĹ¤×÷×éÐÅÏ¢Îļþ¡£
Admins ×é²»Äܱ»É¾³ý£¬Æä³ÉÔ±¾ßÓв»¿É³·ÏûµÄ¹ÜÀíȨÏÞ¡£Äú¿ÉÒÔͨ¹ý²Ëµ¥»ò´úÂëɾ³ý Admins ×éµÄȨÏÞ£¬µ« Admins ×éµÄÈκγÉÔ±¶¼¿ÉÒÔÖØÐÂÌí¼ÓȨÏÞ¡£´ËÍ⣬Admins ×éÖбØÐëʼÖÕÖÁÉÙÓÐÒ»¸ö¹ÜÀíÊý¾Ý¿âµÄ³ÉÔ±¡£¶ÔÓÚûÓнøÐа²È«ÉèÖõÄÊý¾Ý¿â£¬Admins ×éʼÖÕ°üº¬Ä¬È쵀 Admin Óû§ÕÊ»§£¬ËüÒ²ÊÇËùÓÐÓû§Ä¬ÈϵǼµÄÕÊ»§¡£

ËùÓÐÓû§±ØÐëÊôÓÚĬÈ쵀 Users ×飬²»¹ÜËûÃÇÊÇ·ñ»¹ÊôÓÚÆäËû×é¡£Äú¿ÉÒÔÔÚ VBA Öд´½¨Óû§ÕÊ»§£¬¶ø²¢²»½«ÐµÄÓû§ÕÊ»§Ìí¼Óµ½ Admins ×éÖС£È»¶ø£¬Èç¹û²»Í¬Ê±½«¸ÃÓû§ÕÊ»§Ìí¼Óµ½ Admins ×éÖУ¬¸ÃÓû§½«ÎÞ·¨³É¹¦Æô¶¯ Access£¬ÒòΪ Access ÄÚ²¿Ê¹ÓõÄÓÃÓÚ¹ÜÀíÊý¾Ý¿âµÄºÜ¶à±í¶¼Ó³Éäµ½ Users ×éµÄȨÏÞ¡£

ʹÓÃÒÔϲ½Öè½øÐÐ Access Êý¾Ý¿âµÄ°²È«ÉèÖãº

½«ÐÂÓû§ÕÊ»§Ìí¼Óµ½ Admins ×éÖС£¸ÃÓû§¶ÔÊý¾Ý¿âÖеĶÔÏó¾ßÓйÜÀíȨÏÞ¡£
´Ó Admins ×éÖÐɾ³ýĬÈ쵀 Admin Óû§ÕÊ»§¡£
´Ó Admin Óû§ºÍ Users ×éÖÐɾ³ýȨÏÞ¡£
ΪËù´´½¨µÄÈκÎ×Ô¶¨Òå×é·ÖÅäȨÏÞ¡£
ÔÚĬÈÏ Admin Óû§ÕÊ»§ÉÏÉèÖÃÃÜÂë»á¼¤»îµÇ¼¶Ô»°¿ò£¬´Ó¶øÿ´ÎÆô¶¯ Access ʱ¶¼»áÌáʾÓû§ÊäÈëÓû§ÃûºÍÃÜÂë¡£Èç¹ûÄúûÓÐÔÚ Admin ÕÊ»§ÉÏÉèÖÃÃÜÂ룬Óû§½«×Ô¶¯×÷Ϊ Admin Óû§µÇ¼£¬ÎÞÐèÃÜÂ룬Ҳ²»»á³öÏֵǼ¶Ô»°¿ò¡£

¶ÔÊý¾Ý¿âÖжÔÏóµÄȨÏÞ¿ÉÒÔÊÇÏÔʽµÄ£¨Ö±½Ó·ÖÅä¸øÓû§ÕÊ»§£©»òÒþʽµÄ£¨´ÓÓû§ËùÊôµÄ×é¼Ì³Ð£©£¬Ò²¿ÉÒÔÊÇÁ½ÕߵĽáºÏ¡£Access ÔÚȨÏÞÎÊÌâÉÏʹÓá°×îÉÙÏÞÖÆ¡±¹æÔò£¬¼´Óû§µÄȨÏÞ°üÀ¨ÆäÏÔʽºÍÒþʽȨÏÞµÄ×ܺ͡£ÀýÈ磬Èç¹ûÓû§ A µÄÕÊ»§¾ßÓÐÏÞÖÆȨÏÞ£¬¶øÓû§ A ÊôÓÚÒ»¸ö¾ßÓÐÏÞÖÆȨÏÞµÄ×飬ͬʱҲÊôÓÚÁíÒ»¸ö¾ßÓйÜÀí£¨ËùÓУ©È¨ÏÞµÄ×飬ÄÇôÓû§ A ½«¾ßÓйÜÀíȨÏÞ¡£ÓмøÓÚ´Ë£¬Í¨³£×îºÃ²»ÒªÎªÓû§ÕÊ»§·ÖÅäÏÔʽȨÏÞ¡£¶øÓ¦´´½¨¾ßÓв»Í¬È¨ÏÞµÄ×飬Ȼºó½«Óû§·ÖÅä¸ø¾ßÓÐÊʵ±È¨ÏÞµÄ×飬Õâ»á¼õÉÙÊý¾Ý¿â¹ÜÀí·½ÃæµÄÂé·³¡£

ÔÚÒÔϸ÷½ÚÖУ¬ÎÒÃǽ«Õ¹Ê¾ÈçºÎͨ¹ýÓû§½çÃæºÍ±à³ÌÊÖ¶ÎÀ´±£»¤Êý¾Ý¿â¼°Æä°üº¬µÄ¶ÔÏó¡£Ê×ÏÈ£¬ÎÒÃÇÀ´¿´¿´¼¸ÖÖÉèÖÃÊý¾Ý¿âÃÜÂëµÄ²»Í¬·½·¨¡£

ÊÖ¶¯ÉèÖÃÊý¾Ý¿âÃÜÂë
Äú¿ÉÒÔΪÊý¾Ý¿âÉèÖÃÃÜÂ룬´Ó¶øÒªÇóÓû§ÔÚ·ÃÎÊÊý¾Ý¿âʱÊäÈëÃÜÂ롣Ȼ¶ø£¬Ò»µ©Óû§µÇ¼ºó£¬±ã¿ÉÒÔ²»ÊÜÏÞÖƵطÃÎÊÊý¾Ý¿âÖеÄÊý¾ÝºÍ¶ÔÏó¡£

×¢Ò⣺ÔÚÉèÖÃÊý¾Ý¿âÃÜÂë֮ǰ£¬½¨Ò鱸·ÝÊý¾Ý¿â²¢½«Æä´æ´¢ÔÚÒ»¸ö°²È«µÄλÖá£
ÔÚÉèÖÃÊý¾Ý¿âÃÜÂë֮ǰ£¬ÐèÒªÒÔ¶ÀÕ¼·½Ê½´ò¿ªÊý¾Ý¿â¡£ÒªÒÔ¶ÀÕ¼·½Ê½´ò¿ªÊý¾Ý¿â£º

Èç¹ûÊý¾Ý¿â´¦ÓÚ´ò¿ª×´Ì¬£¬¹Ø±ÕÊý¾Ý¿â¡£
µ¥»÷¡°Îļþ¡±²Ëµ¥Öеġ°´ò¿ª¡±ÖØдò¿ªÊý¾Ý¿â¡£
ÔÚ¡°´ò¿ª¡±¶Ô»°¿òÖУ¬ÕÒµ½Êý¾Ý¿â£¬µ¥»÷¡°´ò¿ª¡±°´Å¥ÅԱߵļýÍ·£¬È»ºóµ¥»÷¡°ÒÔ¶ÀÕ¼·½Ê½´ò¿ª¡±¡£
ÒªÊÖ¶¯ÉèÖÃÊý¾Ý¿âÃÜÂ룺

ÔÚ¡°¹¤¾ß¡±²Ëµ¥ÖУ¬Ö¸Ïò¡°°²È«¡±£¬È»ºóµ¥»÷¡°ÉèÖÃÊý¾Ý¿âÃÜÂ롱¡£
ÔÚ¡°ÃÜÂ롱¿òÖУ¬¼üÈëÃÜÂë¡£
×¢Ò⣺ÃÜÂëÇø·Ö´óСд¡£
ÔÚ¡°ÑéÖ¤¡±¿òÖУ¬ÖØмüÈëÃÜÂëÒÔÈ·ÈÏ£¬È»ºóµ¥»÷¡°È·¶¨¡±¡£
ÏÖÔÚ¾ÍÉèÖÃÁËÊý¾Ý¿âÃÜÂ롣ϴÎÄú»òÆäËûÓû§´ò¿ªÊý¾Ý¿âʱ£¬»á³öÏÖÒ»¸ö¶Ô»°¿òÒªÇóÊäÈëÃÜÂë¡£ÏÂÃæÎÒÃÇÀ´¿´¿´ÈçºÎͨ¹ý±à³ÌÉèÖÃÊý¾Ý¿âÃÜÂë¡£

ͨ¹ý±à³ÌÉèÖÃÊý¾Ý¿âÃÜÂë
°´ÒÔÏÂÓ﷨ʹÓùؼü×Ö ALTER DATABASE£¬Äú¿ÉÒÔ±à³ÌÉèÖá¢Ð޸Ļòɾ³ýÊý¾Ý¿âÃÜÂë¡£

ALTER DATABASE PASSWORD NewPassword OldPassword

ÔÚÕâ¸öÓï¾äÖУ¬ÃÜÂëÓÉ·½À¨ºÅ ([]) ·Ö¸ôµÄ String Öµ±íʾ£¬µ«ÏÂÊöÇé¿öÀýÍâ¡£

µÚÒ»´ÎÉèÖÃÊý¾Ý¿âÃÜÂëʱ£¬Ê¹Óà NULL ¹Ø¼ü×Ö×÷Ϊ ALTER DATABASE Óï¾äÖÐµÄ OldPassword ²ÎÊý¡£ÒªÉ¾³ýÊý¾Ý¿âÃÜÂ룬ÇëʹÓà NULL ¹Ø¼ü×Ö×÷Ϊ ALTER DATABASE Óï¾äµÄ NewPassword ²ÎÊý¡£ÔÚÕâЩÇé¿öÏ£¬¹Ø¼ü×Ö NULL ²»Ó¦³öÏÖÔÚ·½¿òÖС£

ÔÚʹÓÃÒÔϹý³Ì֮ǰ£¬¿ÉÄÜÐèÒªÉèÖÃ¶Ô Microsoft ADO Ext 2.5 for DDL and Security ¿âµÄÒýÓã¨Èç¹ûÉÐδÉèÖã©£º

ÔÚ Visual Basic ±à¼­Æ÷ÖУ¬Ö¸Ïò¡°¹¤¾ß¡±²Ëµ¥Öеġ°ÒýÓᱡ£½«ÏÔʾ¡°ÒýÓᱶԻ°¿ò¡£
Ñ¡ÖÐ Microsoft ADO Ext 2.5 for DDL and Security ¸´Ñ¡¿ò¡£
Çë¿´ÒÔϵÚÒ»´ÎÉèÖÃÃÜÂëʱµÄ´úÂ룺

Private Function CreateDBPassword(ByVal Password As String, _
ByVal Path As String) As Boolean
Dim objConn as ADODB.Connection
Dim strAlterPassword as String
On Error GoTo CreateDBPassword_Err
' ´´½¨ SQL ´®ÒÔ³õʼ»¯Ò»¸öÊý¾Ý¿âÃÜÂë¡£
strAlterPassword = "ALTER DATABASE PASSWORD [Password] NULL;"

' ´ò¿ª²»¾ßÓа²È«ÉèÖõÄÊý¾Ý¿â¡£
Set objConn = New ADODB.Connection
With objConn
.Mode = adModeShareExclusive
.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data " & _
"Source=Path;"

' Ö´ÐÐ SQL Óï¾ä¶ÔÊý¾Ý¿â½øÐа²È«ÉèÖá£
.Execute (strAlterPassword)
End With

' Çå³ý¶ÔÏó¡£
objConn.Close
Set objConn = Nothing

' Èç¹û³É¹¦£¬·µ»Ø true¡£
CreateDBPassword = True

CreateDBPassword_Err:
Msgbox Err.Number & ":" & Err.Description
CreateDBPassword = False
End Function

´Ë¹ý³Ì½ÓÊÜÓû§µÄÃÜÂëÒÔ¼° .mdb ÎļþµÄ·¾¶¡£Ê×ÏÈ£¬ÎÒÃÇÉùÃ÷Ò»¸ö±äÁ¿£¬´ú±í¶Ô²»¾ßÓа²È«ÉèÖõÄÊý¾Ý¿âµÄÁ¬½Ó£¬Í¬Ê±ÉùÃ÷Ò»¸ö String ±äÁ¿ÒÔ°üº¬ÎÒÃÇÓÃÓÚ¸ü¸ÄÃÜÂëµÄ SQL Óï¾ä¡£ÏÂÒ»²½£¬ÎÒÃǽ« strAlterPassword ÉèÖøøʹÓà ALTER DATABASE PASSWORD ¹Ø¼ü×ÖµÄ Jet SQL Óï¾ä¡£Çë×¢Ò⣬ÒòΪÎÒÃDz»ÊÇÒªÌæ»»ÃÜÂ룬Òò¶øµÚ¶þ¸ö²ÎÊý±»ÉèÖÃΪ NULL¡£ÏÂÒ»²½£¬ÎÒÃÇ´ò¿ªÒ»¸öµ½¸ÃÊý¾Ý¿âµÄÁ¬½Ó¡£ÒªÉèÖÃÃÜÂ룬±ØÐëÒÔ¶ÀÕ¼·½Ê½´ò¿ªÊý¾Ý¿â£¬Òò´ËÒªÉèÖà Mode ÊôÐÔ¡£È»ºóÖ´ÐÐ SQL Óï¾ä¡£Äúͨ³£¿ÉÒÔ´ÓÒ»¸öÊý¾Ý¿âÔËÐд˹ý³Ì£¬ÒÔ±ãÔÚÒ»¸öµ¥¶ÀµÄ²»¾ßÓа²È«ÉèÖõÄÊý¾Ý¿âÖÐÉèÖÃÃÜÂë¡£Èç¹ûÒ»ÇÐÕý³££¬º¯Êý·µ»Ø True¡£

Èç¹ûÒª¸ü¸Ä¾ßÓа²È«ÉèÖõÄÊý¾Ý¿âµÄÃÜÂ룬Ê×ÏÈÐèҪʹÓþÉÃÜÂëµÇ¼Êý¾Ý¿â£¬È»ºóÔÙ¸ü¸ÄÃÜÂë¡£ÒÔϹý³ÌÏÔʾÁËÕâÒ»¼¼Êõ¡£

ÔÚʹÓÃÒÔϹý³Ì֮ǰ£¬¿ÉÄÜÐèÒªÉèÖÃ¶Ô Microsoft ADO Ext 2.5 for DDL and Security ¿âµÄÒýÓã¨Èç¹ûÉÐδÉèÖã©£º

ÔÚ Visual Basic ±à¼­Æ÷ÖУ¬Ö¸Ïò¡°¹¤¾ß¡±²Ëµ¥Öеġ°ÒýÓᱡ£½«ÏÔʾ¡°ÒýÓᱶԻ°¿ò¡£
Ñ¡ÖÐ Microsoft ADO Ext 2.5 for DDL and Security ¸´Ñ¡¿ò¡£
Çë¿´ÒÔϹý³Ì£º

Private Function ChangeDBPassword(ByVal OldPassword As String, _
ByVal NewPassword As String, ByVal Path As String) As Boolean
Dim objConn as ADODB.Connection
Dim strAlterPassword as String

On Error GoTo ChangeDBPassword_Err

' ´´½¨ SQL ´®ÒÔ¸ü¸ÄÊý¾Ý¿âÃÜÂë¡£
strAlterPassword = "ALTER DATABASE PASSWORD [NewPassword] [OldPassword];"

' ´ò¿ª¾ßÓа²È«ÉèÖõÄÊý¾Ý¿â¡£
Set objConn = New ADODB.Connection
With objConn
.Mode = adModeShareExclusive
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Properties("Jet OLEDB:Database Password") = "OldPassword"
.Open "Data Source=Path;"

' Ö´ÐÐ SQL Óï¾äÒÔ¸ü¸ÄÃÜÂë¡£
.Execute (strAlterPassword)
End With

' Çå³ý¶ÔÏó¡£
objConn.Close
Set objConn = Nothing

ChangeDBPassword = True

ChangeDBPassword_Err:
Msgbox Err.Number & ":" & Err.Description
ChangeDBPassword = False
End Function

´Ë¹ý³ÌÓëÇ°ÃæµÄ×ÓÀý³ÌÀàËÆ£¬Ö»ÊÇÔڵǼ¾ßÓа²È«ÉèÖõÄÊý¾Ý¿âʱ£¬ÐèҪʹÓøü¸Ä֮ǰµÄ¾ÉÃÜÂ롣Ϊ´Ë£¬Õë¶ÔÒª¸ü¸ÄµÄÊý¾Ý¿â£¬ÎÒÃÇÉèÖÃÁË Connection ¶ÔÏóµÄ Database Password ÊôÐÔ¡£ÕâÊÇ Connection ¶ÔÏóµÄÀ©Õ¹ÊôÐÔÖ®Ò»£¬ËùÒÔÎÒÃÇʹÓÃÁËÈçÉÏËùʾµÄÌØÊâÓï·¨¡£Òª´Ó¾ßÓа²È«ÉèÖõÄÊý¾Ý¿âÖÐɾ³ýÃÜÂ룬Ҳ¿ÉÒÔʹÓô˹ý³Ì£¬Ö»Ð轫 ALTER DATABASE Óï¾äµÄµÚÒ»¸ö²ÎÊýÌ滻Ϊ NULL ¹Ø¼ü×Ö¼´¿É¡£

ÏÂÃæÎÒÃÇÀ´¿´¿´ÈçºÎʵÏÖ±ÈÔÚÊý¾Ý¿âÖÐÉèÖÃÃÜÂë¸üÇ¿´óµÄ±£»¤ÊֶΡ£

ʹÓà Security Wizard ÉèÖà Access Êý¾Ý¿âµÄ°²È«ÐÔ
¿ÉÒÔʹÓà Security Wizard ÉèÖÃÊý¾Ý¿âµÄ°²È«ÐÔ¡£Îª´Ë£¬ÇëÖ´ÐÐÒÔϲ½Ö裺

´ò¿ªÒªÉèÖð²È«ÐÔµÄÊý¾Ý¿â¡£
ÔÚ¡°¹¤¾ß¡±²Ëµ¥ÖУ¬Ö¸Ïò¡°°²È«¡±£¬È»ºóµ¥»÷¡°ÉèÖð²È«»úÖÆÏòµ¼¡±¡£½«ÏÔʾ¡°ÉèÖð²È«»úÖÆÏòµ¼¡±¶Ô»°¿ò¡£
ÒòΪÎÒÃÇÒª´´½¨Ò»¸öÐµĹ¤×÷×éÐÅÏ¢Îļþ£¬Òò´ËÇëÈ·±£Ñ¡ÖдËÑ¡ÏȻºóµ¥»÷¡°ÏÂÒ»²½¡±¡£
ÔÚ¡°ÉèÖð²È«»úÖÆÏòµ¼¡±¶Ô»°¿òµÄµÚ¶þ¸öÆÁÄ»ÖУ¨¼ûͼ 1£©£¬Îª¹¤×÷×éÐÅÏ¢Îļþ¼üÈëÒ»¸öÐÂÃû³Æ£¬»òÕß½ÓÊÜĬÈÏÃû³Æ¡£¼üÈëÒ»¸ö¹¤×÷×é ID (WID)¡£WID Ψһ±êʶÁ˴˹¤×÷×éÎļþµÄ Admins ×é¡£ÏÂÒ»²½£¬ÔÚÏàÓ¦µÄÎı¾¿òÖмüÈëÄúµÄÐÕÃûºÍµ¥Î»¡£ËäÈ»ÕâЩÊäÈëÊÇ¿ÉÑ¡µÄ£¬µ«×îºÃ»¹ÊÇÌîÈ룬ÒòΪֻÓÐÖªµÀÕâЩÐÅÏ¢µÄÈ˲ÅÄÜÖØд´½¨¹¤×÷×éÐÅÏ¢Îļþ¡£

µã»÷´ò¿ªÐ´°¿Ú

ͼ 1£º¡°ÉèÖð²È«»úÖÆÏòµ¼¡±¶Ô»°¿òµÄµÚ¶þ¸öÆÁÄ»

ÄúÒ²¿ÉÒÔÑ¡ÔñÊÇ·ñʹÓô˹¤×÷×éÐÅÏ¢Îļþ×÷ΪËùÓÐÊý¾Ý¿âµÄĬÈÏÎļþ£¬»òÕßÖ»ÊÇÓÃÓÚÕâ¸öÌض¨µÄÊý¾Ý¿â¡£µ¥»÷¡°´´½¨¿ì½Ý·½Ê½£¬´ò¿ªÉèÖÃÁË°²È«»úÖƵÄÊý¾Ý¿â¡±Ñ¡ÏȻºóµ¥»÷¡°ÏÂÒ»²½¡±¡£
ÔÚÏÂÒ»¸öÆÁÄ»ÖУ¨¼ûͼ 2£©£¬¿ÉÒÔÑ¡ÔñÏ£ÍûÏòµ¼ÉèÖÃÆ䰲ȫ»úÖƵĶÔÏó¡£Ä¬ÈÏÇé¿öÏ£¬Ïòµ¼½«ÎªËùÓÐÏÖÓжÔÏóºÍËùÓÐд´½¨µÄ¶ÔÏóÉèÖð²È«»úÖÆ¡£µ¥»÷¡°ÏÂÒ»²½¡±¡£

µã»÷´ò¿ªÐ´°¿Ú

ͼ 2£º¡°ÉèÖð²È«»úÖÆÏòµ¼¡±¶Ô»°¿òµÄµÚÈý¸öÆÁÄ»

ÔÚÏÂÒ»¸öÆÁÄ»ÖУ¨¼ûͼ 3£©£¬Äú¿ÉÒÔÑ¡Ôñ¿ÉÑ¡µÄ¾ßÓÐÌض¨È¨Ï޵ݲȫ×é¡£ÎÒÃÇÇ¿ÁÒ½¨ÒéÄúʹÓÃ×éÀ´¹ÜÀíÓû§µÄ·ÃÎÊȨÏÞ£¬¶ø²»ÊǸ³Óèÿ¸öÓû§Ìض¨µÄȨÏÞ¡£Ñ¡ÔñÈκÎÆäËû×éÕÊ»§£¬È»ºóµ¥»÷¡°ÏÂÒ»²½¡±¡£

µã»÷´ò¿ªÐ´°¿Ú

ͼ 3£º¡°ÉèÖð²È«»úÖÆÏòµ¼¡±¶Ô»°¿òµÄµÚËĸöÆÁÄ»

ÔÚ´ËÆÁÄ»ÖУ¨¼ûͼ 4£©£¬Äú¿ÉÒÔΪ Users ×éÉèÖÃÌض¨µÄȨÏÞ¡£ÒòΪËùÓÐÓû§¶¼×Ô¶¯³ÉΪ Users ×éµÄ³ÉÔ±£¬ÔÚ´ËÑ¡ÔñµÄÈκÎȨÏÞ¶¼»áÓ¦ÓÃÓÚËùÓÐÓû§£¬ËùÒÔ×îºÃÏÞÖƸÃ×éµÄȨÏÞ£¬»òÕß±£ÁôĬÈÏÉèÖà - ûÓÐÈκÎȨÏÞ¡£µ¥»÷¡°ÏÂÒ»²½¡±¡£

µã»÷´ò¿ªÐ´°¿Ú

ͼ 4£º¡°ÉèÖð²È«»úÖÆÏòµ¼¡±¶Ô»°¿òµÄµÚÎå¸öÆÁÄ»

ÔÚÏÂÒ»¸öÆÁÄ»ÖУ¨¼ûͼ 5£©£¬Äú¿ÉÒÔÏò¹¤×÷×éÐÅÏ¢ÎļþÖÐÌí¼ÓÓû§¡£»¹¿ÉÒÔΪÿ¸öÓû§Ñ¡ÔñÃÜÂëºÍ¸öÈË ID (PID)¡£Access ʹÓà PID ºÍÕÊ»§ÃûΪ¹¤×÷×é±êʶΨһµÄÓû§¡£Ìí¼ÓÓû§²¢µ¥»÷¡°ÏÂÒ»²½¡±¡£
×¢Ò⣺¸öÈ˱êʶ·û (PID) ²»ÊÇÃÜÂë¡£Ëü±»¼ÓÃܲ¢ÓëÃû³ÆÒ»Æð´´½¨ÁËÒ»¸öΨһµÄϵͳ±êʶ·û (SID)£¬ÓÃÓÚ±êʶÓû§¡£

µã»÷´ò¿ªÐ´°¿Ú


ͼ 5£º¡°ÉèÖð²È«»úÖÆÏòµ¼¡±¶Ô»°¿òµÄµÚÁù¸öÆÁÄ»

ÔÚ´ËÆÁÄ»ÖУ¨¼ûͼ 6£©£¬Äú¿ÉÒÔÏò¹¤×÷×éÐÅÏ¢ÎļþÖеÄ×éÌí¼ÓÓû§¡£½øÐÐÄúµÄÑ¡Ôñºóµ¥»÷¡°ÏÂÒ»²½¡±¡£

µã»÷´ò¿ªÐ´°¿Ú

ͼ 6£º¡°ÉèÖð²È«»úÖÆÏòµ¼¡±¶Ô»°¿òµÄµÚÆ߸öÆÁÄ»

ÔÚ×îºóÒ»¸öÆÁÄ»ÖУ¬Îª²»¾ßÓа²È«ÉèÖõÄÊý¾Ý¿âµÄ±¸·ÝÑ¡ÔñÒ»¸öÃû³Æ¡£±£»¤ºÃ´ËԭʼÊý¾Ý¿âµÄ±¸·ÝÊǺÜÓбØÒªµÄ£¬ÒÔ·ÀÍòÒ»¶ªÊ§»òËð»µÁ˾ßÓа²È«ÉèÖõÄÊý¾Ý¿â¡£µ¥»÷¡°Íê³É¡±¡£Ô­Ê¼Êý¾Ý¿â½«Óà .bak À©Õ¹Ãû±£´æ¡£
¾¯¸æ£ºµ±´´½¨¹¤×÷×éÐÅÏ¢Îļþºó£¬Security Wizard ½«´´½¨Ò»¸ö±¨±í£¬ÆäÖаüº¬ÖØд´½¨¹¤×÷×éÐÅÏ¢ÎļþËùÐèµÄËùÓÐÐÅÏ¢¡£Äú±ØÐë±£´æºÃ´ËÐÅÏ¢£¬ÒÔ±ãÔÚԭʼÎļþ¶ªÊ§»òËð»µÊ±ÖØд´½¨Îļþ¡£
µ¥»÷¡°Íê³É¡±ºó£¬Security Wizard ½«¼ÓÃÜÊý¾Ý¿â£¬È»ºóÒªÇóÄúʹÓÃÐµĹ¤×÷×éÐÅÏ¢ÎļþÖØдò¿ª½øÐÐÁË°²È«ÉèÖõÄÊý¾Ý¿â¡£
ÏÂÃæÎÒÃÇÀ´¿´¿´¼¸ÖÖ±à³ÌʹÓÃÓû§ºÍ×éµÄ·½·¨¡£

ͨ¹ý±à³ÌÌí¼ÓºÍɾ³ýÓû§ºÍ×é
ΪÊý¾Ý¿âÉèÖÃÁË°²È«ÐÔºó£¬Äú¿ÉÄÜÐèҪʹÓÃÓû§ºÍ×é¡£ÒÔϸ÷½ÚչʾÁËÆäÖеÄһЩ¼¼ÇÉ¡£

ÔÚʹÓÃÒÔϸ÷½Ú½éÉܵĹý³Ì֮ǰ£¬¿ÉÄÜÐèÒªÉèÖÃ¶Ô Microsoft ADO Ext 2.5 for DDL and Security ¿âµÄÒýÓã¨Èç¹ûÉÐδÉèÖã©£º

ÔÚ Visual Basic ±à¼­Æ÷ÖУ¬Ö¸Ïò¡°¹¤¾ß¡±²Ëµ¥Öеġ°ÒýÓᱡ£½«ÏÔʾ¡°ÒýÓᱶԻ°¿ò¡£
Ñ¡ÖÐ Microsoft ADO Ext 2.5 for DDL and Security ¸´Ñ¡¿ò¡£
Ìí¼ÓºÍɾ³ýÓû§
ÒÔϹý³Ì½«´´½¨Ò»¸öеÄÓû§ÕÊ»§£¬È»ºó½«Æä×·¼Óµ½ÓÃÓÚµ±Ç°Êý¾Ý¿âµÄ¹¤×÷×éÐÅÏ¢ÎļþÖеÄĬÈÏ Users ×é¡£

×¢Ò⣺ҪÔÚ Access ÖÐʹÓÃÏÂÃæµÄʾÀý£¬ÄúÐèÒª×÷Ϊ Admins ×éµÄ³ÉÔ±µÇ¼²¢´ò¿ªÒ»¸öÊý¾Ý¿â¡£ÔÚÏÂÃæµÄ¹ý³ÌÖУ¬ÄúҪȷ±£¹¤×÷×éÐÅÏ¢Îļþ²»°üº¬ÔÚ strUser ÖÐÖ¸¶¨ÁËÆäÃû³ÆµÄÓû§¡£ÀýÈ磬Äú¿ÉÒÔÏȵ÷Óà DeleteUser ×ÓÀý³ÌÀ´È·±£ÕâÒ»µã¡£
Çë¿´ÒÔÏ´úÂ룺

Private Function AddUser(ByVal strUser As String, _
ByVal strPID As String, _
Optional ByVal strPwd As String) As Boolean
Dim catDB As ADOX.Catalog

On Error GoTo AddUser_Err

' ʵÀý»¯ Catalog ¶ÔÏó¡£
Set catDB = New ADOX.Catalog
With catDB
' ʹÓõ½µ±Ç°Êý¾Ý¿âµÄÁ¬½Ó´ò¿ª
' Catalog ¶ÔÏó¡£
.ActiveConnection = CurrentProject.Connection
' ´´½¨ÐµÄÓû§ÕÊ»§¡£
.Users.Append strUser, strPwd, strPID
' ÏòĬÈÏ Users ×é×·¼ÓеÄÓû§ÕÊ»§¡£
.Groups("Users").Users.Append strUser
End With

' ¹Ø±Õ Catalog ¶ÔÏó¡£
Set catDB = Nothing

AddUser = True

AddUser_Err:
Msgbox Err.Number & ":" & Err.Description
AddUser = False
End Function

¸Ã¹ý³ÌÊ×ÏÈΪ Catalog ¶ÔÏóÉùÃ÷Ò»¸ö±äÁ¿£¬È»ºóʵÀý»¯¸Ã¶ÔÏó¡£

×¢Ò⣺Catalog ¶ÔÏóÊÇ Access Êý¾Ý¿âÎļþÖÐËùÓжÔÏóµÄÈÝÆ÷¡£
È»ºó£¬¸Ã¹ý³Ì´ò¿ªµ½µ±Ç°Êý¾Ý¿âµÄÁ¬½Ó£¬²¢Ê¹ÓÃÀ´×Ôµ÷Óùý³ÌµÄ²ÎÊý£¬½«ÐÂÓû§×·¼Óµ½ Catalog ¶ÔÏóµÄ Users ¼¯ºÏÖС£È»ºóÐÂÓû§±»×·¼Óµ½Ä¬È쵀 Users ×é¡£Users ¼¯ºÏ°üº¬ÁËÔÚ¹¤×÷×éÐÅÏ¢ÎļþÖж¨ÒåµÄÊý¾Ý¿âµÄËùÓÐÓû§¡£

Ҫɾ³ýÏÖÓÐÓû§£¬¿ÉÒÔʹÓÃÒÔϹý³Ì£º

Private Function DeleteUser(ByVal strUser As String) As Boolean
Dim catDB As ADOX.Catalog

On Error GoTo DeleteUser
' ʵÀý»¯ Catalog ¶ÔÏó¡£
Set catDB = New ADOX.Catalog
With catDB
' ÔÚµ±Ç°Êý¾Ý¿âÖдò¿ª Catalog ¶ÔÏó¡£
.ActiveConnection = CurrentProject.Connection
' ɾ³ý strUser¡£
.Users.Delete strUser
End With

' ¹Ø±Õ Catalog ¶ÔÏó¡£
Set catDB = Nothing

DeleteUser = True

DeleteUser_Err:
Msgbox Err.Number & ":" & Err.Description
DeleteUser = False
End Function

´Ë¹ý³ÌÓëÇ°ÃæµÄ¹ý³ÌÀàËÆ£¬Ö»ÊÇʹÓÃÁË Catalog ¶ÔÏóµÄ Delete ·½·¨É¾³ýÁËÔÚ strUser String ²ÎÊýÖÐÖ¸¶¨µÄÓû§¡£

Ìí¼ÓºÍɾ³ý×é
Ìí¼Ó×éµÄ¹ý³ÌÓëÌí¼ÓÓû§µÄ¹ý³ÌÀàËÆ¡£

Private Function AddGroup(ByVal strGroup As String, _
ByVal strPID As String) As Boolean
Dim catDB As ADOX.Catalog

On Error GoTo AddGroup_Err

Set catDB = New ADOX.Catalog
With catDB
' ÔÚµ±Ç°Êý¾Ý¿âÖдò¿ª Catalog ¶ÔÏó¡£
.ActiveConnection = CurrentProject.Connection
' ´´½¨ÐµÄ×é¡£
.Groups.Append strGroup, strPID
End With

' ¹Ø±Õ Catalog ¶ÔÏó¡£
Set catDB = Nothing

AddGroup = True

AddGroup_Err:
Msgbox Err.Number & ":" & Err.Description
AddGroup = False
End Function

´Ë¹ý³ÌÊ×ÏÈʵÀý»¯ Catalog ¶ÔÏó£¬È»ºó´ò¿ªÒ»¸öµ½µ±Ç°Êý¾Ý¿âµÄÁ¬½Ó¡£½ÓÏÂÀ´£¬Í¨¹ýʹÓÃÀ´×Ôµ÷Óùý³ÌµÄ²ÎÊý£¬½«ÐÂ×é×·¼Óµ½ Catalog ¶ÔÏóµÄ Groups ¼¯ºÏ¡£

Ҫɾ³ýÏÖÓÐ×飬¿ÉÒÔʹÓÃÒÔϹý³Ì£º

Private Function DeleteGroup(ByVal strGroup As String) As Boolean
Dim catDB As ADOX.Catalog

On Error GoTo DeleteGroup_Err

Set catDB = New ADOX.Catalog
With catDB
' ÔÚµ±Ç°Êý¾Ý¿âÖдò¿ª Catalog ¶ÔÏó¡£
.ActiveConnection = CurrentProject.Connection
' ɾ³ý strGroup¡£
.Groups.Delete strGroup
End With

' ¹Ø±Õ Catalog ¶ÔÏó¡£
Set catDB = Nothing

DeleteGroup = True

DeleteGroup_Err:
Msgbox Err.Number & ":" & Err.Description
DeleteGroup = False
End Function
´Ë¹ý³ÌÓëÇ°ÃæµÄ¹ý³ÌÀàËÆ£¬Ö»ÊÇʹÓÃÁË Catalog ¶ÔÏóµÄ Delete ·½·¨É¾³ýÁËÔÚ strGroup String ²ÎÊýÖÐÖ¸¶¨µÄ×é¡£

ÏÂÃæÎÒÃÇÀ´¿´¿´ÈçºÎͨ¹ý±à³ÌÉèÖöÔÊý¾Ý¿â¶ÔÏóµÄȨÏÞ¡£

ͨ¹ý±à³ÌÉèÖÃȨÏÞ
Òª¶ÔÊý¾Ý¿âÖеĸ÷ÖÖ¶ÔÏóÉèÖÃȨÏÞ£¬¿ÉÒÔʹÓà Group »ò User ¶ÔÏóµÄ SetPermissions ·½·¨¡£ÔÚÏÂÃæµÄ¹ý³ÌÖУ¬ÎÒÃÇÊ×Ïȳ·Ïû×éµÄËùÓÐȨÏÞ£¬È»ºóÔÙ¸³Óè×éÌض¨µÄȨÏÞ¡£ÕâÑù¿ÉÒÔÈ·±£¸Ã×éÖ»¾ßÓÐÎÒÃÇÖ¸¶¨µÄȨÏÞ£º

Private Function SetGroupPermissions(ByVal strGroup As String, _
ByVal strTable As String, ByVal strObjectType As String, _
ByVal strAction As String, _
ByVal strRevokeEnum As String) As Boolean
Dim catDB As ADOX.Catalog

On Error GoTo SetGroupPermissions_Err

Set catDB = New ADOX.Catalog
With catDB
' ÔÚµ±Ç°Êý¾Ý¿âÖдò¿ª Catalog ¶ÔÏó¡£
.ActiveConnection = CurrentProject.Connection
' ³·Ïû×éµÄËùÓÐȨÏÞ¡£
.Groups(strGroup).SetPermissions tblTable, _
strObjectType, strAction, strRevokeEnum

' ¸³Óè×éÌض¨µÄȨÏÞ¡£
.Groups(strGroup).SetPermissions tblTable, _
strObjectType, strAction, _
adRightRead Or adRightInsert Or adRightUpdate
End With

' ¹Ø±Õ Catalog ¶ÔÏó¡£
Set catDB = Nothing

SetGroupPermissions = True

SetGroupPermissions_Err:
Msgbox Err.Number & ":" & Err.Description
SetGroupPermissions = False
End Function

ÔÚµ±Ç°Êý¾Ý¿âÖдò¿ªÒ»¸ö Catalog ¶ÔÏóºó£¬ÎÒÃÇʹÓÃÁË Groups ¼¯ºÏµÄ SetPermissions ·½·¨£¬³·ÏûÁ˸Ã×é¶Ô Employees ±íµÄËùÓÐȨÏÞ¡£µÚÒ»¸ö²ÎÊýÊDZíµÄÃû³Æ£¬µÚ¶þ¸ö²ÎÊýÏÔʾÁ˶ÔÏóµÄÀàÐÍ£¬ÕâÀïÊÇ±í¡£µÚÈý¸ö²ÎÊýÖ¸¶¨ÁËÔÚÉèÖÃȨÏÞʱҪִÐеIJÙ×÷µÄÀàÐÍ£¬µÚËĸö²ÎÊýÊÇÒ»¸öȨÏÞ³£Êý£¬Ö¸¶¨Á˸Ã×éûÓÐÈκÎȨÏÞ¡£ÎÒÃÇÒѾ­³·ÏûÁ˸Ã×é¶Ô Employees ±íµÄËùÓÐȨÏÞ£¬ÏÖÔÚ¿ÉÒÔ¸³ÓèÆäËùÏ£ÍûµÄȨÏÞ¡£

ÏÂÒ»¸öÓï¾äµÄÇ°Èý¸ö²ÎÊýÓëÇ°Ò»¸öÓï¾äÖеÄÏàͬ¡£µÚËĸö²ÎÊýÊÇͨ¹ýʹÓà Or ÔËËã·û£¬×éºÏ²»Í¬µÄȨÏÞ³£ÊýËù´´½¨µÄÒ»¸öÖµ¡£ÕâÀÎÒÃǸ³ÓèÁ˶ÁÈ¡¡¢²åÈëºÍ¸üиñíµÄȨÏÞ¡£

Òª¶ÔÖ¸¶¨ÀàÐÍ£¨ÀýÈçÉÏÊöʾÀýÖÐµÄ±í£©µÄËùÓÐжÔÏóÉèÖÃȨÏÞ£¬Ç뽫ÓÃÓÚ¸³ÓèȨÏÞµÄÓï¾äÖеĵÚÒ»¸ö²ÎÊý¸ü¸ÄΪ NULL ¹Ø¼ü×Ö¡£ÀýÈ磺

¡­
catDB.Groups(strGroup).SetPermissions NULL, adPermObjTable
¡­


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

Êý¾Ý¿âÉè¼ÆÖеÄÃô½Ý·½·¨ 2004-2-9 11:19:16
µ÷ÓÃoutlookÉú³É²¢·¢ËÍÓʼþµÄ´úÂë 2004-1-30 10:32:07
ʲôÊÇ API£¿ 2004-1-28 15:01:53
SQL SERVER»ù±¾¸ÅÄîѧϰӡÏó 2004-1-1 21:23:13
Ò»×éSQL ServerÉí·ÝÑéÖ¤¹ÜÀí×Ó³ÌÐò 2003-12-31 16:29:54
ERwin--¼ò»¯µÄÊý¾Ý¿âÉè¼Æ¹¤¾ß 2003-12-15 12:41:40
±£»¤Access 2000Êý¾Ý¿âµÄ°²È« 2003-11-13 11:16:12
·ÀÖ¹Access 2000ÃÜÂë±»ÆÆÒëµÄ·½·¨ 2003-11-13 11:14:21
Access 2000Êý¾Ý¿âµÄÃÜÂëÍüÁËÔõô°ì 2003-11-13 11:05:39
ACCESSµÄÊý¾Ý¿â°²È«ÎÊÌâ½â´ð 2003-11-13 10:52:11
´æ´¢¹ý³ÌÈëÃÅ 2003-10-17 19:06:48
MS Jet SQL for Access 2000Öм¶Æª (I) 2003-10-17 18:47:38
½« Microsoft Access ÓÃ×÷ Automation ·þÎñÆ÷ 2003-10-14 8:37:19
ACCESSÊý¾Ý·ÃÎÊÒ³ÅäÖÃʵÀý 2003-10-14 8:36:00
ÈçºÎÕï¶Ï/ÐÞ¸´Ëð»µµÄ Jet 4.0 Êý¾Ý¿â 2003-10-14 8:31:26
Êý¾Ý¿âÉè¼Æ·¶Ê½ 2003-10-10 10:40:52
Óà Access 2000 ´ò¿ª Access 97 Êý¾Ý¿âʱ³öÏÖ¡°ÃÜÂëÎÞЧ¡±´íÎó 2003-10-6 16:13:52


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



ÎÄÕÂËÑË÷



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

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