How to create a new DB with code?

  • Thread starter Thread starter Kline
  • Start date Start date
K

Kline

Could anyone point me to an article that can explain to
me how to create an Access database in code using Visual
Basic .NET?

I really don't want an OLEDB connection .... I want a
private database that simply resides as a file on my
system and is accessed directly by the software I write.
It is NOT intended for the internet or to be read or
written too by anyone over a network.

I also don't want to use any controls that simplify the
process and limit my ability. I want to do it all in code.

Thank you in advanced,
K
 
Could anyone point me to an article that can explain to
me how to create an Access database in code using Visual
Basic .NET?

I really don't want an OLEDB connection ....

Well, if you want to do ANYTHING with a database, you need to have a
connection to it - even if it resides locally on your machine!

"Connection" doesn't mean something that goes out to the network or
internet - it just means a way to get at your data. Without
connection, you can't do anything - period.

Marc

================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
¤ Could anyone point me to an article that can explain to
¤ me how to create an Access database in code using Visual
¤ Basic .NET?
¤
¤ I really don't want an OLEDB connection .... I want a
¤ private database that simply resides as a file on my
¤ system and is accessed directly by the software I write.
¤ It is NOT intended for the internet or to be read or
¤ written too by anyone over a network.
¤
¤ I also don't want to use any controls that simplify the
¤ process and limit my ability. I want to do it all in code.

You have two choices and both will require COM interop. One uses ADOX (Microsoft ADO Ext 2.x for DDL
and Security) and OLEDB with Jet is required. The other uses the original (and somewhat dated) Jet
database engine layer DAO (no OLEDB is required).

There is no native .NET Jet database engine layer so you will have to rely on the COM objects.

If there is one that you would prefer, post a follow-up and we can come up with an example.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
There is no native .NET Jet database engine layer so you will have to rely on the COM objects.

Well, there's a native OleDB provider which can talk to any OleDB
database - including MS Access / Jet, no??

Marc

================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
Marc,

Paul is correct, there is no native .net Jet engine
layer. If you read the original post correctly, that is
essentially what Kline wanted, the kind of connection and
control over an Access database the we got from DAO. ADOX
is also a very good solution. Good post Paul.

If I could humbly offer another suggestion to Kline; have
you considered using xml for the data store instead? In
the situation you describe, it might work for you.

Kirk

ps. I hope I didn't just get in the middle of an MVP
fight. If so, I want both of you to know that I am a
confirmed coward and will "RUN AWAY, RUN AWAY!", just as
fast as I can. (Please, no rabbits)

-----Original Message-----
will have to rely on the COM objects.
 
¤ >There is no native .NET Jet database engine layer so you will have to rely on the COM objects.
¤
¤ Well, there's a native OleDB provider which can talk to any OleDB
¤ database - including MS Access / Jet, no??

Yes you can *connect* to an Access database using the native .NET OLEDB provider and the Jet OLEDB
provider, but there is no facility for *creating* an Access database using the native .NET OLEDB
provider.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
¤ >There is no native .NET Jet database engine layer so you will have to rely on the COM objects.
¤
¤ Well, there's a native OleDB provider which can talk to any OleDB
¤ database - including MS Access / Jet, no??

Yes you can *connect* to an Access database using the native .NET OLEDB provider and the Jet OLEDB
provider, but there is no facility for *creating* an Access database using the native .NET OLEDB
provider.

Okay, thanks, that clears it up - I've never really done much in
Access, but I thought there was a way to get at Access tables if
needed. And I just assumed that would also give me the opportunity to
create new Access DB's if needed - thanks for clarifying. One more
reason for me not to use Access anymore.

Marc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
ps. I hope I didn't just get in the middle of an MVP fight. If so, I want both of you to know that I am a
confirmed coward and will "RUN AWAY, RUN AWAY!", just as fast as I can. (Please, no rabbits)

<hehe> don't worry - I was just trying to get an understanding of what
you guys mean by "native Jet layer" - Paul cleared that up quite
nicely.

No rabbits?!?!?! ;-) I don't quite follow..... some inside joke or
somethin' ??

In that spirit: what's a wok? A wok is what you twow at a wabbit .....
;-))

Marc

================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
Back
Top