+ Reply to Thread
Results 1 to 5 of 5

Retrieve row count from an OLE DB data source

  1. #1
    Registered User
    Join Date
    04-22-2009
    Location
    Boston
    MS-Off Ver
    Excel 2013
    Posts
    68

    Retrieve row count from an OLE DB data source

    Hello ,
    I am trying to get no of rows from a table with a where clause.
    I am having difficulty in writing the code as I am not able to find objects like "OleDbDataReader" or "OleDBCommand".

    I have addded all the references I could but I don't know what I am missing.
    I have the connection string ready as I obtained from a UDL file.

    Progress so far

    Please Login or Register  to view this content.
    Please help. I could connect to OLEDB data source using Excel .

  2. #2
    Forum Contributor
    Join Date
    12-28-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    280

    Re: Retrieve row count from an OLE DB data source

    You would need to create a new instance of the Class ie:

    Please Login or Register  to view this content.
    before you assign values to it.
    For testing your Regular Expression patterns, try my Regular Expression Pattern Testing add-in!

    For notes on how to use it - see here.

  3. #3
    Registered User
    Join Date
    04-22-2009
    Location
    Boston
    MS-Off Ver
    Excel 2013
    Posts
    68

    Re: Retrieve row count from an OLE DB data source

    I get the error "Invalid use of New keyword"

  4. #4
    Forum Contributor
    Join Date
    12-28-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    280

    Re: Retrieve row count from an OLE DB data source

    Can I ask what source of data you are targeting? Is it a database? In which case I would think you want to use ADO?

  5. #5
    Registered User
    Join Date
    04-22-2009
    Location
    Boston
    MS-Off Ver
    Excel 2013
    Posts
    68

    Re: Retrieve row count from an OLE DB data source

    Yes using ADO was the solution.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1