How to put an MS Access database into the resources

R

Rainman_54

I built a small test project using visual studio 2008 and make a
connection to an existing Acces database. I was able to integrate this
database into some resources in my project. Now I want to make the
connect to this database of course without "hard code" the path to the
database but use a mechanism which "points" to the resources
containing the database. Is there any mechanism to do that ?

Regards
 
C

Cor Ligthert[MVP]

Rainman,

As an Access Database is not a DataBase server but simple a DataBase file,
will that not as easy as with a DataBase server (Like SQL Server).

Some of the reasons ODBC was created was in my idea to make a more flexible
connection to DataBase files (Excel, Lotus123 are other DataBase files)

However it is real from far in the past milenium.

Cor
 
G

Gregory A Greenman

I built a small test project using visual studio 2008 and make a
connection to an existing Acces database. I was able to integrate this
database into some resources in my project. Now I want to make the
connect to this database of course without "hard code" the path to the
database but use a mechanism which "points" to the resources
containing the database. Is there any mechanism to do that ?


I'm using VS2003, so maybe there's a better way of which I am
unaware, but what I do is copy the code for the connection string
from the generated code into my Form load procedure. I remove the
hard coded path and replace it with a variable. I store the path in
the registry. Before filling my tables, I test the file & path to
be sure they exist. If they do, I fill my tables. If not, I give
the user an open file dialog so that they can tell my program where
the data is located.
 
C

Cor Ligthert[MVP]

Gregoryu,

Almost everybody here will advise you to go to SQL Server Express, it has
less restrictions then Jet (Access does not exist but the Jet database is
often called so. Access is an application that uses a Jet Database)

Cor
 

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