Question

When transfering file to another location i always need to change the source or directory..

Dim cnn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Renz\Desktop\FINAL\Database\AuditDB.mdb")

Is there a way I can avoid that?

Was it helpful?

Solution

You could use a path relative to your applications location, e.g.

Dim cnn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Database\AuditDB.mdb")

Where in this example I am presuming that your database is stored in a folder called Database in the same folder as your program.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top