Without having tested it, I think you can connect to the Master database and use the Execute method to lauch sp_attach.
>I need to attach / detach Ms. SQL database (MDF) via VB6's code? could any body help me how to do this? or where can I find the article for it? TIA
>
>
>Winan
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com