Home All Groups Group Topic Archive Search About

VB.NET create JET database without ADOX

Author
23 Apr 2006 10:50 PM
Dan Hinsley
I'm converting an app over to VS 2005, and am trying to get rid of all
the external references possible.  I use JET to create a database.
Before I used the ADOX.Catalog function to do this.  I assume that
there's got to be a way to do this with ADOX, but I haven't been able
to get there.

I have to have a connection to issue the CREATE DATABASE command, but
if I use Data Source=foo, where foo is the name I want the file to be,
connect fails with file not found.  If I leave Data Source off the
connection I get a DB_SEC_E_AUTH_FAILED.  Is there an equivalent to
Data Source=(local) for JET?  Or how can I completely create a
database without resorting to ADOX?

Thanks,

Dan

Author
24 Apr 2006 12:51 PM
Paul Clement
On Sun, 23 Apr 2006 15:50:49 -0700, Dan Hinsley <da***@exmsft.com> wrote:

¤ I'm converting an app over to VS 2005, and am trying to get rid of all
¤ the external references possible.  I use JET to create a database.
¤ Before I used the ADOX.Catalog function to do this.  I assume that
¤ there's got to be a way to do this with ADOX, but I haven't been able
¤ to get there.
¤
¤ I have to have a connection to issue the CREATE DATABASE command, but
¤ if I use Data Source=foo, where foo is the name I want the file to be,
¤ connect fails with file not found.  If I leave Data Source off the
¤ connection I get a DB_SEC_E_AUTH_FAILED.  Is there an equivalent to
¤ Data Source=(local) for JET?  Or how can I completely create a
¤ database without resorting to ADOX?

Creating a Jet database using code requires either DAO, ADOX or automation with Microsoft Access.


Paul
~~~~
Microsoft MVP (Visual Basic)
Author
24 Apr 2006 3:08 PM
Dan Hinsley
Are any of these available as part of .NET 2.0?  Or do I have to
include a reference to an external DLL for any of the three?

Thanks,

Dan

On Mon, 24 Apr 2006 07:51:48 -0500, Paul Clement
<UseAdddressAtEndofMess***@swspectrum.com> wrote:

Show quote
>On Sun, 23 Apr 2006 15:50:49 -0700, Dan Hinsley <da***@exmsft.com> wrote:
>
>¤ I'm converting an app over to VS 2005, and am trying to get rid of all
>¤ the external references possible.  I use JET to create a database.
>¤ Before I used the ADOX.Catalog function to do this.  I assume that
>¤ there's got to be a way to do this with ADOX, but I haven't been able
>¤ to get there.

>¤ I have to have a connection to issue the CREATE DATABASE command, but
>¤ if I use Data Source=foo, where foo is the name I want the file to be,
>¤ connect fails with file not found.  If I leave Data Source off the
>¤ connection I get a DB_SEC_E_AUTH_FAILED.  Is there an equivalent to
>¤ Data Source=(local) for JET?  Or how can I completely create a
>¤ database without resorting to ADOX?
>
>Creating a Jet database using code requires either DAO, ADOX or automation with Microsoft Access.
>
>
>Paul
>~~~~
>Microsoft MVP (Visual Basic)
Author
24 Apr 2006 4:59 PM
Paul Clement
On Mon, 24 Apr 2006 08:08:39 -0700, Dan Hinsley <da***@exmsft.com> wrote:

¤ Are any of these available as part of .NET 2.0?  Or do I have to
¤ include a reference to an external DLL for any of the three?
¤

You just need to add the COM reference for whichever library you choose to use. I'm afraid there is
no way around using interop in this instance.


Paul
~~~~
Microsoft MVP (Visual Basic)
Author
24 Apr 2006 6:01 PM
Cor Ligthert [MVP]
Paul,

I could have answered this before you. I thought let me not do it, not that
Paul has found some news the last days.

:-)

Cor

Show quote
"Paul Clement" <UseAdddressAtEndofMess***@swspectrum.com> schreef in bericht
news:gt0q429rl2m0nt1t3kem6ac6ej5koda7ff@4ax.com...
> On Mon, 24 Apr 2006 08:08:39 -0700, Dan Hinsley <da***@exmsft.com> wrote:
>
> ¤ Are any of these available as part of .NET 2.0?  Or do I have to
> ¤ include a reference to an external DLL for any of the three?
> ¤
>
> You just need to add the COM reference for whichever library you choose to
> use. I'm afraid there is
> no way around using interop in this instance.
>
>
> Paul
> ~~~~
> Microsoft MVP (Visual Basic)
Author
25 Apr 2006 12:07 PM
Paul Clement
On Mon, 24 Apr 2006 20:01:34 +0200, "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote:

¤ Paul,
¤
¤ I could have answered this before you. I thought let me not do it, not that
¤ Paul has found some news the last days.
¤

Cor,

You're certainly welcome to answer the question before me, just as long as you do so correctly. ;-)

I split my time between forums (MSDN, DevX) so sometimes it takes me longer to respond to posts.


Paul
~~~~
Microsoft MVP (Visual Basic)
Author
24 Apr 2006 5:02 PM
Paul Clement
One other option I suppose I should mention is that you could just distribute an empty database and
use it as a template to create new database files.


Paul
~~~~
Microsoft MVP (Visual Basic)

AddThis Social Bookmark Button