Build your connection string at runtime.
Use
GetEntryAssambly[
^] and it's
Location[
^] property.
using System;
using System.IO;
using System.Reflection;
namespace My
{
class Program
{
public static void Main()
{
string folder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
string filename = Path.Combine(folder, "text.accdb");
string connectiostring = String.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0}",filename);
Console.WriteLine(connectiostring);
}
}
}