• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 913
  • Last Modified:

Making database portable in VB.net

I am a VB.net programmer.  I am using oledb's (Access)  How do I make these portable?  I have tried putting in bin folder and it still doesn't work.

2 Solutions
Ralf KlattPrincipal ConsultantCommented:

Connection to your database can be done using DSN-less connection strings ... for MS Access it would be:

With ODBC:
"Driver={Microsoft Access Driver (*.mdb)}; Dbq=c:\yourDB.mdb;"

"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\yourDB.mdb;"

If you change the path it could also leed to the "bin" directory of your application:


Best regards,
What do you mean by "portable"?  Do you mean make it part of the deployable installation package?

I can think of two ways that should work... there are probably more.  

1.  Since XCOPY is one of the simpler methods of deployment you could easily incorporate the commands to copy all the files
     you project requires.  You could wrap this up in any of the windows scripting languages or even a bat file.

2.  Depending on what type of project you're deploying there are various "Setup Wizard" tools and editors available.  One of those editors is for "Custom actions"... here you can define any program you need to run during the installation of your app.

I;m going by memory for this since I haven't worked much with .net the past couple of years.  I'm hoping to get back into it again "as soon as I can find the time" ;-)

What do you mean by "portable"?  Do you mean make it part of the deployable installation package?

Can you actually do that?

So then you can hide or encrypt the database on the client machine.

Thanks for suggestions

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now