Here is the code
please suggest how should i close the rs?(you will know "rs" whenyou see the code)
Also, please be sure to use code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.
You can go back and change your post to add code tags by clicking the button on your post.
"operation is not allowed when object is closed" is caused by the rs.close statement. If you want to insert the record, simply use the connection's execute method:
You'll see it's not necessary to use the recordset object. Moreover, If you plan to run the file locally, it's better to save it as ".hta" format, which can bypass the security checking and you can limit the file as single instance, too:
I've zipped the above example together with an Access file in the following link if you want to see the outcome: download page