Creating Access DB without ADOX

J

John Carret

Is it possible to create a new Access database file without ADOX? I have to store an empty MDB file for further use now and I'd
like to get rid of it. It would be great to create new database files when I need them. I do not like the fact I have to store
the new MDB file somewhere. ADOX is not an option for me, because that means I need to store the interop DLL somewhere too.

Just for the record: the database files I'm working with in my application are stored locally and are accessed through OLE DB
Data Provider.

Any ideas?

Thanks...

J.C.
 
P

Paul Clement

¤ Is it possible to create a new Access database file without ADOX? I have to store an empty MDB file for further use now and I'd
¤ like to get rid of it. It would be great to create new database files when I need them. I do not like the fact I have to store
¤ the new MDB file somewhere. ADOX is not an option for me, because that means I need to store the interop DLL somewhere too.
¤
¤ Just for the record: the database files I'm working with in my application are stored locally and are accessed through OLE DB
¤ Data Provider.

If you don't use ADOX then you need to use DAO. Those are the only options short of distributing an
empty database file.

I'm not sure what your issue is with interop assemblies. It's just a dependency file that you
distribute with your app and can place in the same folder as your application assembly.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
J

John Carret

Paul, thank you for your response... I'm concerned with copyright. I mean: is it legal to distribute interop assemblies with my
application
developed in Visual C# 2005 Express Edition?

This leads to another question: is it possible to embed this interop assembly into the compiled application? If so, how?

With regards
John Carret


Paul Clement napsal(a):
 
P

Paul Clement

¤ Paul, thank you for your response... I'm concerned with copyright. I mean: is it legal to distribute interop assemblies with my
¤ application
¤ developed in Visual C# 2005 Express Edition?

Absolutely no issue whatsoever. Interop assemblies are generated (or provided) so that you can use
COM components with .NET. They can be freely distributed, unless otherwise indicated.

¤
¤ This leads to another question: is it possible to embed this interop assembly into the compiled application? If so, how?
¤

I'm not aware of any tool that will allow you to embed an interop assembly into your application
assembly.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
J

John Carret

Paul, thank you very much for your time.

With regards
J.C.


Paul Clement napsal(a):
 
M

Mark Rae

Those are the only options short of distributing an empty database file.

That's certainly what I do. I store a completely empty, zipped, MDB as an
embedded resource and simply extract it and decompress it whenever required.
Means I don't have to worry about ADOX, DAO, InterOp or anything like
that...
 
C

Cowboy \(Gregory A. Beamer\)

You cna shell out the MDB file. Copy the shell to a location and then run
you DDL commands to create tables, etc. If you know the basic table
structure, the shell can contain that info. Then, you only have to create
the additional tables.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
 
J

John Carret

Hi Gregory,
thanks for your suggestion. This is the exact thing I've decided to do... :)

With regards
J.C.
 
C

Cowboy \(Gregory A. Beamer\)

It is not the most elegant solution, but it works in most cases.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
 
J

John Carret

Well, I've found even better solution yesterday. It is to compress the new database file using
the GZipStream (present in .NET 2.0) and embed it into the application. Since the compressed
file is quite small it doesn't significantly increase the application file size.

With regards
J.C.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top