I have managed to run a test successfully connecting to Microsoft SQL Server Express using TMSSQLConnection, TSQLQuery, TSQLTransaction and TDatasource. I can connect to an existing database, read records from a table and display these using a TDBGrid.
However, when trying to create a *new* database on the server, I come against a "Catch 22" situation because TMSSQLConnection requires a database name to make a connection, and (understandably) throws an error if I give the name of a database that doesn't already exist.
Is there a way to create a new database using the visual components, or do I need to create a console application, omitting the components? I have only a vague idea of how to carry out what I want, and can't seem to find any examples. Can anyone point me to an example of how to create a new MS SQL database in code, or give a few hints?
Thank you.