Hi Again All,

I have a Datasource which I query, works fine but when I package the application it can't find the datasource (which is an mdb file) how do I set the datasource to always look in the application path.

I have tried str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= App.Path + \REPRINT.MDB;Persist Security Info=False" but it doesn't like this either. As always any help is appreciated.

Recommended Answers

All 3 Replies

Hi
Try this str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\REPRINT.MDB;Persist Security Info=False"

Excellent ! Thank you .

i also face this problem in Visual Studio 2010 express. The problem which code should be replaced with your code? in order to prevent program defining data source file path by itself.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.