[C#] Create Access DB file...

Started by
1 comment, last by Mike 19 years, 10 months ago
Is there a way in C#.Net to create the database file if it does not already exist? I know how to take an empty database and add tables and such to it with no problem, but I don''t know how to create the actuall .mdb file if it is not present.
Advertisement
You might be able to do it using OLE Automation interface of MSAccess itself, but I wouldn''t hold your breath.

I would probably go for shipping a "skeleton" mdb file with your app, and just copying the file into the right place before you mess with it.

OLE Automation is pretty unreliable in my experience.

Mark
This might help: http://www.codeguru.com/vb/gen/vb_database/microsoftaccess/article.php/c5149

Regards,
Andre Loker

[edit]BTW: it was a 5 sec google-search-work...[/edit]

[edited by - VizOne on June 3, 2004 12:43:45 PM]
Andre Loker | Personal blog on .NET

This topic is closed to new replies.

Advertisement