ªð¦^¦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 : ªY½à§O¤H´N¬O²øÄY¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD