lidds Posted August 17, 2005 Posted August 17, 2005 I have the need to copy a database in MSDE using vb.net code, and I was wondering if anyone has done this that would not mind sharing the code. I think the process would be something like: 1) Determine location of .mdf and .ldf file that you wish to copy 2) Detach database that you wish to copy 3) Copy the .mdf and .ldf file and rename to new name 4) Attach both the new and old database As I quite new to vb.net the major problem that I can see with this is error handling, as you would always want the database that you are copying to be re-attached to SQL server. Any help on this subject would be appreshiated. Thanks Simon Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.