Gareth,
Look at your data. This doesn't nullify anything twinnyfo and Stewart have said, but I suspect you are encountering a name that has a quote within the name. You are not handling that possibility and when it happens it gives you a bad SQL string and the behavior you are seeing.
Jim
Look at your data. This doesn't nullify anything twinnyfo and Stewart have said, but I suspect you are encountering a name that has a quote within the name. You are not handling that possibility and when it happens it gives you a bad SQL string and the behavior you are seeing.
Jim
Comment