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

[µo°Ý] ¨D§U,office2003Âàoffice2016°õ¦æ°»´ú¿ù»~¶¥¬q'3706 ½Ð°Ý¦p¦ó­×¥¿

[µo°Ý] ¨D§U,office2003Âàoffice2016°õ¦æ°»´ú¿ù»~¶¥¬q'3706 ½Ð°Ý¦p¦ó­×¥¿

¥»©«³Ì«á¥Ñ HSIEN6001 ©ó 2019-9-16 02:25 ½s¿è

¨D§U,office2003Âàoffice2016°õ¦æ°»´ú¿ù»~¶¥¬q'3706 ½Ð°Ý¦p¦ó­×¥¿?
¥t¥~,½Ð°Ý§Úªº¤Þ¥Î¶µ¥Ø¥¿½T?
  1. Sub ¤ÀªR()
  2. Dim myCN As New ADODB.Connection
  3. Dim myRS As New ADODB.Recordset
  4.     myCN.Provider = "Microsoft.Jet.OLEDB.4.0"
  5.     myCN.Properties("Data Source") = "D:\¸ê°T.accdb.accdb"
  6.     myCN.Open
  7.       
  8.     With myRS
  9.         .Source = "SELECT * FROM [# 00 ¤ÀªR]"
  10.         .ActiveConnection = myCN
  11.         .CursorType = 3
  12.         .LockType = 3
  13.         .Open   '¶}±Ò¸ê®Æªí¤~¯à¨ú±o¸ê®Æ¦C
  14.             Sheets("¸ÑªR").Select
  15.             Range("I65536").End(xlUp)(2).Select   '¶K¦b[?66536]³Ì¥½+1
  16.             ActiveCell.CopyFromRecordset myRS
  17.         .Close  'Ãö³¬¸ê®Æªí
  18.     End With
  19.     myCN.Close
  20. End Sub
½Æ»s¥N½X

3706.jpg (12.13 KB)

¿ù»~3706

3706.jpg

¦^´_ 1# HSIEN6001
§A2016ª© ³]©w  myCN.Provider = "Microsoft.Jet.OLEDB.4.0"   
¥i¬d¬Ý https://social.msdn.microsoft.co ... b40-32bit-and-64bit
§Ú³Ì°ªª©¥»2010 ³]¬°   .Provider = "Microsoft.ACE.OLEDB.12.0" ¥i¸Õ¸Õ¬Ý
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# GBKEE

    ·PÁ¶W¯Åª©¥D¡AÁ`¬O«Ü§Öªº¨ó§U¾Ç¥Í­Ì¡A¯u¤ß·PÁÂ
¤§«e¤w¸gª¦¤å­×§ï¹L¤@¦¸À³¥Î  .Provider = "Microsoft.ACE.OLEDB.12.0"
³o¬q­×¥¿«á¡A·|¥X²{§ä¤£¨ìÀÉ®× "D:\¸ê°T.accdb.accdb"   ¡ö¡ö¡ö¬Ý§Ú¦h²Ê¤ß ¯uÁV¿| .accdb ®³±¼«á­±¦h¾l½Æ»s

»²§U¥H¬ÛÃö®M¥óªº¤U¸ü
Microsoft Access Database Engine 2010 ¥iÂà´²µo®M¥ó
http://www.microsoft.com/downloads/details.aspx?FamilyID=C06B8369-60DD-4B64-A44B-84B371EDE16D&displayLang=zh-tw


¬ÛÃöª¦¤å:
http://frankiestudy.blogspot.com/2011/11/microsoftjetoledb40.html
http://sharedderrick.blogspot.com/2011/08/msg-7308msg-7320msg-7415-7302-7308-7415.html
https://www.microsoft.com/zh-tw/download/confirmation.aspx?id=13255

¤w¸g¦w¸Ë¥i´²µo®M¥ó>°õ¦æµ²ªG¦¨¥\¤F
PS:·PÁÂÄ@·N¦b¦¹´£¨Ñ¨ó§Uªº¨C¤@¦ì¡A¤]ÁÂÁ¨ä¥L¤À¨É¨Ï¥Î¸gÅçªÌ¡A¨ó§U§Ú­Ì«e¶i¡A


°õ¦æ¦¨¥\ ..^__^..
  1. Sub ¤ÀªR()
  2. Dim myCN As New ADODB.Connection
  3. Dim myRS As New ADODB.Recordset
  4.     myCN.Provider = "Microsoft.ACE.OLEDB.12.0"
  5.     myCN.Properties("Data Source") = "D:\¸ê°T.accdb"
  6.     myCN.Open
  7.       
  8.     With myRS
  9.         .Source = "SELECT * FROM [# 00 ¤ÀªR]"
  10.         .ActiveConnection = myCN
  11.         .CursorType = 3
  12.         .LockType = 3
  13.         .Open   '¶}±Ò¸ê®Æªí¤~¯à¨ú±o¸ê®Æ¦C
  14.             Sheets("¸ÑªR").Select
  15.             Range("I65536").End(xlUp)(2).Select   '¶K¦b[?66536]³Ì¥½+1
  16.             ActiveCell.CopyFromRecordset myRS
  17.         .Close  'Ãö³¬¸ê®Æªí
  18.     End With
  19.     myCN.Close
  20. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : §Ú­Ì³Ì¤jªº¼Ä¤H¤£¬O§O¤H¡D¥i¯à¬O¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD