Hi Jason,
Seems I made a stupid mistake. There was nothing wrong with the way I was connecting to the database, but I used the same resultset in my function StarDatabase, so when I changed this to a new resultset everything worked ...
But thank you anyway