A trick that I use is too include a blank (or pre-populated schema) database
as an embedded resource with a dll (class). I can then save this empty jet
database to disk in a known location and access it from there. This avoids
connection, and executing 'CREATE TABLE ...' style statements. As mentioned
"Mitchell Vincent" <mitchell.vincent@gmail.com> wrote in message
news:%23XZZI4UsEHA.3196@TK2MSFTNGP14.phx.gbl...
> George Shubin wrote:
>
> > "Mitchell Vincent" <mitchell.vincent@gmail.com> wrote in message
> > news:Obyy7TTsEHA.2560@TK2MSFTNGP14.phx.gbl...
> >
> >>I would also like to know if anyone has any VB.NET code to *create*
Access
> >>databases and add DSNs programatically so that I don't have to rely on
the
> >>user to set everything up correctly.
> >
> >
> > As far as creating a fresh database from code, I use a tool,
> >
http://www.smithvoice.com/dbcopier.aspx that creates the VB.Net logic
from
> > my development database. It reads my database and generates all the
code
> > necessary to create an empty database on the fly. You have to have a
> > reference to ADOX in your project.
> >
>
> Very nice tool. I can hardly believe it is free :-)
>
> > Also, I don't bother with DSNs. Use a config file or registry entry or
ini
> > file to save the database's location and use DSN-less connections:
> >
> > sDBLocation = "c:\Data\MyDB.mdb"
> > oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
> > "Data Source=" & sDBLocation &_
> > "User Id=admin;" & _
> > "Password="
> >
>
> That goes to show what I know. I thought a DSN was needed :-)
>
> I'll have a look into ADOX as I can't say that I know the difference
> between ADO, ADO.NET and ADOX..
>
> > And you're right. Access databases, if treated right, will work just
fine
> > (to a point). I've had several of my clients' LAN applications with up
to
> > 10 concurrent users work with few problems connected with Access'
reputed
> > deficiencies. I've never had a corruption problem or a bloating problem
in
> > over 6 years.
> >
> > We're talking LAN apps here, not web apps, right?
>
> Yes, LAN apps.
>
> --
> - Mitchell Vincent