Hi,
Well i got the solution to the abouve problem.Heres for every one
string
constr=@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=..\\..\\RightAccess.accdb";
just pass this string along with OleDb connection obeject to OleDb command.
I wanted Data Soruce path which was indepedent of the machine.The above one is a relative path , relative to the folder were you have installed the programme.
I believe same works for SqlConnection.
Thanks