Thanks for your reply, Tibor. I'll check into DMO. That sounds
closer to the approach I want to take. (Any reason NOT to use DMO?)
You're welcome
. Personally, I prefer to send TSQL command, as I see no
real reason to abstract the TSQL commands with ah object layer. Regarding
future compatibility; it is a two way street; TSQL command can change but
object layer stay the same (abstracts the change) but also object layer can
change. MS has indicated that there will be a new object layer in Yukon, but
I'd be surprised if they didn't keep DMO at current level for compatibility
reasons.
For now, I've tried issuing SQL commands inside the program, and I was
surprised that the initial connect string worked without having to
specify a database. So I was able to get the db created.
You probably ended up inside your default database for your login.
I did run into a glitch when trying to delete it in the same fashion
(connect string with no db specified). Exception says that the db is
in use, despite my having issued a close. Not sure what is going on
there.
Did you do USE database inside your app? Perhaps the connection was still
hanging around and that kept you from deleting the database? Try USE master
before closing connection. Check using sp_who, sp_who2 etc.