I have our code connecting successfully to SQL Servers and opening existing databases, but when I try to create a new database I get the following error:

I figured the easiest way to create a new database was simply by invoking the SQL command "CREATE DATABASE [databasename]", but apparently I have to have another database already selected before calling this code. Why is that, and is there any way around this limitation?
When attempting to create a new database, I simply connect to a server with the TMSConnection::Database property left blank. Based on the SDAC docs, I thought the server still connected to whatever default database is set up for the user (perhaps the "master" database)? If that's true, then why am I getting this error?
Most importantly, is there a better way to create new databases via the SDAC components?