Just keep a file or embedded resource of a blank Access database somewhere.
Then when you want to create a database, copy that empty .MDB file to where
you want it, and use ADO.NET to execute SQL commands such as CREATE TABLE.
I think the only problem you might run into is setting the "Allow
Zero-Length String" property of a text field. When setting it with SQL
statements, you can not properly set this setting.
If this is not a problem, then copying a blank .MDB file and using pure
ADO.NET is certainly more elegant than interoping with ADOX. You could also
interop with DAO to set this property---I'm actually not certain which is
easier to program and deploy
Incidentally... (a bit off topic)...
The next version of SqlServer (Yukon) is supposed to have managed objects
for creating the database. If these classes follow the design pattern of
the rest of ADO.NET and use common interfaces that aren't specific to any
database (like a SqlCatalog which implements IDbCatalog), then perhaps
somebody will implement a version that can do the same with an Access
database (maybe a JetCatalog). It could possibly use ADOX on the back end.
I seem to think MS won't do it, as they seem to be phasing out Jet, but I
wouldn't rule out someone else writing it. If there is indeed a common
interface, and not just concrete classes, I would certainly be interested in
similar classes for Oracle, Db2, Jet, etc...
--Matthew W. Jackson