Create DB without ADOX

G

Guest

I have Googled this topic to death to the best of my ability and hope that
somebody here can help.

I do not want to have any COM dependencies in a project. For various
reasons, the application will use an Access database. Unfortunately, it
appears ADO.NET does not allow you to create a database and tables.
Everything I have seen seems to point to ADOX, but that requires an ActiveX
component which I extremely want to avoid.

Does anybody know how to programmatically create an Access DB and tables in
that DB without using a COM object?

Thanks in advance for any help.
 
C

Cowboy \(Gregory A. Beamer\) [MVP]

The issue is not creating tables, as Ican send DDL to every database I have
worked with without problem. The issue is creating the original database. To
completely avoid COM, you end up creating a database template (.mdb with no
tables) and copying it where you need it. You can then add objects to the
database, as long as they are definable in SQL (for example, forms are
objects you cannot write out in SQL, so you have to use Access objects (COM)
to set them up).

NOTE: I have not dinked fully with the Office .NET components. With these,
you may be able to do more of the creation, etc., of Office docs and files.
You note this is aimed at Office 2003 (maybe XP?), so it is not applicable
to all versions.

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

************************************************
Think Outside the Box!
************************************************
 
C

Cowboy \(Gregory A. Beamer\) [MVP]

The Access objects are definitely easier, but unless the Office .NET
components are complete in that area, you end up with some Interop.

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

************************************************
Think Outside the Box!
************************************************
 
P

Paul Clement

¤ I have Googled this topic to death to the best of my ability and hope that
¤ somebody here can help.
¤
¤ I do not want to have any COM dependencies in a project. For various
¤ reasons, the application will use an Access database. Unfortunately, it
¤ appears ADO.NET does not allow you to create a database and tables.
¤ Everything I have seen seems to point to ADOX, but that requires an ActiveX
¤ component which I extremely want to avoid.
¤
¤ Does anybody know how to programmatically create an Access DB and tables in
¤ that DB without using a COM object?
¤
¤ Thanks in advance for any help.

There is no way to eliminate COM dependencies from this process, and you're not adding an ActiveX
component since your project will still be dependent upon MDAC and Jet (for an Access database) if
you are using OLEDB.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 

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