I’m working with a legacy vb6 product and I’ve come across a problem whereby I need to get the filename part of a full path from a database table through DAO. I’ve got no access to VBA functions here so I’m looking specifically for MS Access SQL. I have no way of dropping some extra code after the query. I CAN’T change/refactor the solution short of modifying the SQL.
Now, DAO doesn’t have any instrrev or replace functionality so I’m pretty limited.
Any guesses out there?
Thanks in advance.
Assuming you can’t change the actual database . . .
The only thing I can think of (and I wracked by brains on this one, sorry mate) is to use repeated calls to instr, nested in iif statements e.g. to replace this call to inStrRev
You’d have a compeltely insane
This will work for a path thats 10 or so sub folders deep.
If you think 10 sub folders is too little, I’ve a bit of vba to generate the statement to what ever depth you require.
It is obscene, but should work