I don't see the exact cause of your problem, but here are some suggestions:

Use Server.CreateObject instead of CreateObject. Your code will run safer.

Use a forward-only, read-only recordset, and don't use MoveFirst. You don't seem to need a more resource consuming one.