Вопрос

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?

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top