If you put a debug.print line in after the strFilename line, this will give you the text of the file you are trying to find, maybe the text is not quite right. i.e.
c:\datarefresh.txt instead of c:\data\refresh.txt
Thanks for all the replies, I am will get this working in the module first, then I will add it to either a class or an add-in. Thanks for your help.
PP
I think you could use this.
sub currentdirectory()
dim strCD as string
dim strFilename
strCD = ActiveWorkbook.Path
strFilename = strCD & "\Refresh.txt"
....rest of code here....
end sub
Thanks for the replies, Skip the code you posted works, but it only returns one field, I need to return a recordset of data from different tables i.e one call could be to the client table and another could be to suppliers table. I am not sure how to return a recordset???
Thanks
Paul
Hi,
I am trying to create a generic module to take an SQL statement as an argument and connects to an oracle db, which then returns the resulting recordset back to the calling module for processing. I have managed to create the connection to retrieve a recordset, but I have to repeat the code...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.