Search code examples
c#databaseoledbadox

Is it possible to create a MS Access database using OLEDB?


I've seen a few answers to this, but all of them use ADOX which I don't exactly know how to use. Is it possible to do it entirely with OLEDB? If so, how? Thanks in advance


Solution

  • The database itself (i.e. the empty .accdb file) cannot be created via OLEDB.

    But once you have an empty access file, you can connect to it via OLEDB, and then you can create tables, views, etc. by executing create table statements.

    I once did a solution where I packed an empty database directly into my resources and copied it at runtime into a user's directory.