Click here to Skip to main content
15,891,713 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an existing SQL database with an accompanying VB(2015) application. Presently the two are on different drives. I would like to put both on a thumb drive so I can access it on any computer.

There are 2 obvious problems;

1 How do I transfer the data file to the thumb drive and still have the application find it?
2 When moving the thumb drive from one computer to another the drive designation will change, how do I tell the application to handle this?

What I have tried:

I have tried to do the above, but when I put the drive in a different computer I get a file not found error.
Posted
Updated 20-Jun-17 7:31am

Use the applications path to determine the location of the database see here:
[^]
 
Share this answer
 
I assume you are using SQL Server, unfortunately SQL Server is notoriously difficult to deploy in such a way.
So if possible think of alternatives like storing your data in XML format, or using a more suitable database like SQLite or PostgreSQL (which has a portable version), PostgreSQL Portable download | SourceForge.net[^]
Here is a small VB.NET example: PostgreSQL and VB.NET-VBForums[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900