relative path and MS Access

Posts   
 
    
nmarun
User
Posts: 27
Joined: 31-Jul-2006
# Posted on: 20-Apr-2007 23:31:35   

Hi,

I'm working with a web service and MS Access database in the backend. Since llblgen is taking care of the data access layer for me, I'm not sure how to use Server.MapPath to point to the relative path of the database.

Thanks Arun

Posts: 254
Joined: 16-Nov-2006
# Posted on: 21-Apr-2007 21:57:21   

I'm not sure if I fully understand your question so perhaps you could clarify further if I've misunderstood.

Are you trying to specify the connection string for a MS access database at runtime? If your using Server.MapPath to build a physical path to a ms access database from a relative path you can simply use the result of this call as part of the connection string e.g.

DbUtils.ActualConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("/MyAccessDb.mdb") + ";User Id=admin;Password=;Jet OLEDB:System Database=;Jet OLEDB:Database password=";