Posts by DaveUK31

    Re: Using VBA as a database tool via ADO


    Thanks cytop I used the schema example above and this is working great across both. Thank you once again for your help & apologies for the cross posting (I won't do that again in the future).


    Cheers

    Re: Using VBA as a database tool via ADO


    Thank you very much cytop this is excellent.
    One last thing- this works on numbers (e.g. 123) but I would also want it to work on character references too (e.g. the ABC at the footer of the text file). Is this simple to do?
    I tried changing the below but this still only worked on the numbers


    Code
    str = "SELECT * FROM [test1.txt] WHERE [aa]=" & CStr(Range("B2"))

    Hi Guys,


    You'll see from the example attached I have the below code which will bring back certain records I require from a tab delimited file where the first column in the txt file matches the reference in cell B2.


    This works great however I want it to work via an ADO macro (module 3) as it will work faster on a txt file with massive numbers of records. I am getting an error however on the ".open str" bit of the module 3 code. Can anyone help?


    Below is the code I am trying to get to work as I understand for example if my txt file was huge (e.g. 2 million plus records) this would process much faster.