ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] Excel¤u§@ªí³æ»PAccess¸ê®Æ®wªºVBA¤¬°Ê°ÝÃD

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2013-12-27 18:03 ½s¿è

¦^´_ 30# JEAN
³o­Ó¬O§R°£¸ê®Æ¿ýªºµ{¦¡½X¡A
¨ä¤º®e¬O­º¥ý·|§R°£ Sheets("data") ¤º¹ïÀ³ªº³Q§R°£¸ê®Æ¡A
±µµÛ¡B¦^ÀY¤SÄ~Äò¥h§R°£Àx¦s¦b Access ªº¹ïÀ³ªº¸ê®Æ¡A¥H«O«ù¨âªÌ¸ê®Æ¦P¨B¤§¬G¡C
­º¥ý¡B©pÀ°§ÚÀˬd¤@¶µ°Ê§@¡G
A¡B  ¥ý¤Ä¿ï  "SQL Data"¡CµM«á¦b "¦W¦r" ÄæÀH«K¿é¤J¤@¦W¦r¡B¦p¡G LuLu¡C
B¡B  ¿é§¹ LuLu «á¡AÂI¿ï "¿é¤J½T©w" «ö¶s¡A±µµÛÂI¿ï "ñÃÒ¤º®e1"¡B©ÎªÌ¬O
         "ñÃÒ¤º®e2"¡AµM«áÁ@Á@¸Ì­±¦³¨S¦³ "ñÃҿﶵ"¡A¦pªGµª®×¬O "Yes"¡A
        ¨º«K­n®¥³ß©p¤w§ä¨ì(³sµ²¨ì) Access ¸ê®Æ®w¤F¡C
C¡B  ³Ì«á©p¤~§i¶D§Ú¡A©p¹ê»Ú·Q°µªº¬O¬Æ»ò¡H

TOP

¦^´_ 26# JEAN
³o¸Ì¡A§Ú¤w¦A¥[¤J¤@­Ó·sªº¤u§@ªí³æ Sheets("¾÷²¼µn¿ý")¡A¦b¦¹ªí³æ¤º
"¾÷²¼µn¿ý" ¥u³æ¯Â³B²z¸ê®Æ·s¼W¡B§ó·s¡B§R°£¡B­«¸mµ¥¿é¤J§@·~¡A¬ÛÃöªº
¸ê®ÆÀx¦s§@·~«h¥þ¥æ¥Ñ Access ¾÷²¼°O¿ý©ú²Óªí.mdb ¸ê®Æ®w¦s¨ú¬ö¿ý¡C
¦Ü©ó­ì Sheets("data") ªº¬ö¿ý«h¨ÌµM«O¯dµ¹¤u§@ªí³æ "¾÷²¼§@·~"¡A
§@¬°Âù¦VÀx¦s½d¨Ò¤§¥Î¡C¤]´N¬O»¡¡B¤u§@ªí³æ "¾÷²¼µn¿ý" ©Î³\´N¬O
©pªº»Ý¨D (µ{¦¡½X¦b¨ä"¾÷²¼µn¿ý"¥»¨­¤u§@ªí³æ¤º)¡A©p¥i¥H±N¥¦»P
"¾÷²¼§@·~"¤º¤§µ{¦¡½X¬Û¤¬¤ñ¸û¡A«K¥i»â·|¨âªÌ¤§¶¡³B²z¤Wªº®t²§¡A
¶i¦Ó¥i§@¬°©p­Ó¤H»â°ì¤W¤§±´°Q¤Î¬ã¨s¡C

TOP

¦^´_ 26# JEAN
¶¶§ÇÀ³¥ý±q ThisWorkbook ªºµ{¦¡½X¬Ý°_¡AµM«á¦A¤À§O¥hÁA¸Ñ
Sheets("¾÷²¼§@·~")¡B¥H¤Î Sheets("¾÷²¼µn¿ý") ¤ºªºµ{¦¡½X¡A
©pªº­«ÂI¥i¥H¥ý©ñ¦b ("¾÷²¼µn¿ý") ¤W¡C ²z¸Ñ«á¦A¦æ¥hÅé·|
("¾÷²¼§@·~")¡B¦p¦¹©pªº¶i®i¤~·|¶¶§Q¡C³Ì«á¤~¥hÁA¸Ñ "¼Ò²Õ"
¸Ì¦p¦ó³B¸Ì ComboBox ¤º¦p¦óÀ³¥Î·Æ¹«ºu¶bªº¹B§@(Hook)¡B
¥H¤Î¦p¦óÄÀ©ñ (UnHook)¡C¦Ü©ó¸ê®Æ®wµ²ºc«O«ù¤£ÅÜ(Mdf¡BAccdb)¡C
³Ì«á¡B¯¬©p¤@¦|­·¶¶¡I
2014¦~¾÷²¼°O¿ý.rar (123.68 KB)

TOP

¦^´_ 33# c_c_lai


    ±z¦n:   §Ú¦³§Aªº¤èªk...·|¥X²{³o­Ó¿ù»~~~~
      

    ±z¦n:   §Ú§âÀɮפG­Ó©ñ¦b¤@°_¤W¶Çµ¹§A~~½ÐÀ°§Ú¬Ý¬Ý..ÁÂÁ±z
      2014¦~¾÷²¼°O¿ý¤G­ÓÀɮפ@°_.rar (141.5 KB)

TOP

¦^´_ 34# JEAN
½Ð°Ý©p¬O­n°õ¦æ MDF ¸ê®Æ®w¡B§í©Î¬O ACCDB ¸ê®Æ®w¡H
¦]³o¨âºØ¸ê®Æ®wªºÅX°Êµ{¦¡¬O¤£¦Pªº¡C
For Access MDF (2003)¡G
  1.     .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & _
  2.                           ThisWorkbook.Path & Application.PathSeparator & "¾÷²¼°O¿ý©ú²Óªí.mdb" & ";"
½Æ»s¥N½X
For Access Accdb (2007¡B2010)¡G
  1.     '  For Microsoft.ACE.OLEDB.12.0,you need Microsoft Office 12.0 Access Database Engine to be installed.
  2.     .ConnectionString = "Provider=Microsoft.Ace.OLEDB.12.0;" & "Data Source=" & _
  3.                          ThisWorkbook.Path & Application.PathSeparator & "¾÷²¼°O¿ý©ú²ÓªíÀÉ®×.accdb" & ";"
½Æ»s¥N½X
·í©p­n¨Ï¥Î Accdb ¸ê®Æ®w®É¡A©pµ{¦¡½XªºÅX°Êµ{¦¡«K­n±Ò°Ê For Access Accdb¡B¤Ï¤§¥çµM¡C

TOP

¦^´_ 35# c_c_lai


    ±z¦n: ¤½¥qªº¹q¸£¬O¥Îoffice 2007ªº    ¤£¹LexcelÀx¦sªº¤è¦¡¬O2003   ¦]¬°¨ä¥L¤H¬O¥Î2003ªºª©¥»¡C
               ¤£¹L access 2007ªº  ©Ò¥H·|¥Î2007ªº¤è¦¡Àx¦s¡C

               ½Ð°Ý§A»¡ªºMDF¸ê®Æ®w¬O¤°»ò??   ¨S¦³¾Ç¹L  .¤£¯u¦n·N«ä

TOP

¦^´_  c_c_lai


    ±z¦n: ¤½¥qªº¹q¸£¬O¥Îoffice 2007ªº    ¤£¹LexcelÀx¦sªº¤è¦¡¬O2003   ¦]¬°¨ä¥L¤H¬O ...
JEAN µoªí©ó 2013-12-30 12:25

¦]¬°¬Ý¨ì©pªþ¥óªºÀɮ׫¬ºA¬O .accdb ¤~·|¦³¦¹¤@°Ý¡C
MDF ¬O Access 2003 ªºÀx¦sÀɪº¦sÀÉÃþ«¬¡A
ACCDB «h¬O Access 2007¡B2010 ªºÀx¦sÀɪº¦sÀÉÃþ«¬¡C
¦b  Excel 2007¡B2010 ªºÀô¹Ò¤U¥i¥H¦s¨ú 2003¡B¤Î¨ä (2003) ¥H¤Wª©¥»
ªº¸ê®Æ®w¡C¤]´N¬O»¡¦]¬°¶Q¤½¥q¨ä¥L¤H§¡¨Ï¥Î 2003 ª©¥»ªº Office,
ÁöµM©pªº¬O Office 2007¡A ¦b¦¹±ø¥ó±¡ªp¤U¡A §A«K¥i¥H¦Ò¶q¥þÅ駡
¨Ï¥Î mdf ªºÀɮסC´N¤£­n¨Ï¥Î accdb «¬ºAªº¸ê®Æ®wÀɮסA§_«h¨ä¥L
¨Ï¥Î 2003 ª©¥»ªº¦P¨Æ³£µLªk¨Ï¥Î¡A¤Ó¬ð¥Xªºªí²{¤]¬O¤£¦nªº¡C
¦p¦¹¸Ñ»¡¥i§_¸Ñ¨M¤F©pªº§x´b¡H ¦¹®ÉÅX°Ê¤è¦¡«h­n¥Î¡G

  1.        .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & _
  2.                           ThisWorkbook.Path & Application.PathSeparator & "¾÷²¼°O¿ý©ú²Óªí.mdb" & ";"
½Æ»s¥N½X

TOP

¦^´_ 34# JEAN
­ì¥»»yªk¦b 2010 °õ¦æ OK¡A¬°ÁקK§xÂZ½Ð­×¥¿¦p¤U¡G

TOP

¦^´_ 36# JEAN
2014¦~¾÷²¼°O¿ý.xls §Úµyµy­×¥¿¦p¤U¡G


2014¦~¾÷²¼°O¿ý.rar (153.35 KB)

TOP

¦^´_ 39# c_c_lai


  ±z¦n:  ÁÂÁ±zªºÀ°¦£~~~§Ú¦³¤@ÂI·Q©ñ±ó¤F,¦]¬°¤@ª½µo¥Í¿ù»~,°Ý¤uµ{®v,¥L¤]»¡¤£ª¾¹D¡C

TOP

        ÀR«ä¦Û¦b : ½_ÁJµ²±o¶V¹¡º¡¡A¶V·|©¹¤U««¡A¤@­Ó¤H¶V¦³¦¨´N¡A´N­n¶V¦³Á¾¨Rªº¯ÝÃÌ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD