+ Reply to Thread
Results 1 to 33 of 33

Get matching values using ADO from closed CSV file

Hybrid View

  1. #1
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,008

    Re: Get matching values using ADO from closed CSV file

    I don't see where your code makes any attempt to read from the CSV file?
    Everyone who confuses correlation and causation ends up dead.

  2. #2
    Forum Contributor
    Join Date
    06-07-2011
    Location
    Hnd
    MS-Off Ver
    Excel 2010
    Posts
    161

    Re: Get matching values using ADO from closed CSV file

    Quote Originally Posted by romperstomper View Post
    I don't see where your code makes any attempt to read from the CSV file?
    Hi romperstomper,

    I put the code almost as a reference of what I think could be the way, using ADO, but I'm a beginner in that area.

    I was hoping to understand how that example works and then try to change to a csv, but even that example not seem to show the output as they say.
    In my case I think the middle part of the code would be something like:
    objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
        "Data Source=C:\MyFiles\;" & _
            "Extended Properties = ""text; HDR=No ""," 
    
    objRecordset.Open "Select * FROM Origin.csv Where X = Y", _
        objConnection, adOpenStatic, adLockOptimistic, adCmdText
    The part in red X=Y should be values in column A of Results.xlsx that are equal to values in A of Origing.csv. I don't know how would be the syntax here and how to retrieve values in other columns for matching rows.

    Like a start I tried following exactly with file in example and didn't work for me, actually my computer hanged when the "Do until EOF loop" was executed.

    Maybe you can help me to get the desired result.

    Many thanks in advance.

+ 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