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

ADO¦s¨ú¸ê®Æ®w .RecordCountªð¦^­È°ÝÃD

ADO¦s¨ú¸ê®Æ®w .RecordCountªð¦^­È°ÝÃD

¤£¦n·N«ä , ·Q½Ð±Ð¤@¤U§Ú¦bExcel VBA¸Ì¥ÎADODB¦s¨úAccess¸ê®Æ®w
¥N½X¦p¤U , ¥i¬ORecordCountªð¦^­È«o¬O-1¦Ó¤£¬O¬d¸ß¨ìªºµ§¼Æ
½Ð°Ý­n¦p¦ó­×§ï¤~¹ï?
  1. Sub test()
  2.     Dim adoConnect As New ADODB.Connection
  3.     Dim oRS As New ADODB.Recordset
  4.    
  5.     With adoConnect
  6.         .Provider = "Microsoft.ACE.OLEDB.12.0"
  7.         .Mode = adModeReadWrite
  8.         .ConnectionTimeout = 15
  9.         .Open "G:\stock\DB_Stock_0926.accdb"
  10.     End With

  11.     Set oRS = adoConnect.Execute("SELECT * FROM MyTable")
  12.     Debug.Print oRS.RecordCount
  13.         
  14.     adoConnect.Close
  15.     Set oRS = Nothing
  16.     Set adoConnect = Nothing
  17. End Sub
½Æ»s¥N½X

¦^´_ 1# stillfish00


    ¸Õ¸Õ¦h¥[¤@¦æ
        .CursorLocation = adUseClient
¦b.Provider ¤§¤U
À´±oµo°Ý,µª®×´N·|¦b¨ä¤¤

¤µ¤éの¤@¬íは  ©ú¤éにない
http://kimbalko-chi.blogspot.com
http://kimbalko.blogspot.com

TOP

¦^´_ 2# kimbal
«z ~ ÁÂÁ , ³o¼Ë­È´N¥¿½T¤F:D

TOP

        ÀR«ä¦Û¦b : ¡i¥Í©R¦b©I§l¶¡¡j¦òªû»¡¡G¡u¥Í©R¦b©I§l¶¡¡C¡v¤HµLªkºÞ¦í¦Û¤vªº¥Í©R¡A§óµLªk¾×¦í¦º´Á¡AÅý¦Û¤v¥Ã¦í¤H¶¡¡C¬JµM¥Í©R¥h¨Ó³o»òµL±`¡A§Ú­Ì§óÀ³¸Ó¦n¦n¦a·R±¤¥¦¡B§Q¥Î¥¦¡B¥R¹ê¥¦¡AÅý³oµL±`¡BÄ_¶Qªº¥Í©R¡A´²µo¥¦¯uµ½¬üªº¥ú½÷¡A¬M·Ó¥X¥Í©R¯u¥¿ªº»ù­È¡C
ªð¦^¦Cªí ¤W¤@¥DÃD