我教你.
string currentPath=System.IO.Directory.GetCurrentDirectory();//获取应用程序的当前目录
sting  yourData=currentPath+@"data\resistance.mdb";//你的MDB数据文件路径
Data Source=yourData;

解决方案 »

  1.   

    string strPath = Server.MapPath("index.aspx");
    strPath = strPath.Substring(0,strPath.Length - "index.aspx".Length);
    strPath += "\\data\resistance.mdb";
      

  2.   

    Data Source=Server.MapPath("resistance.mdb");
      

  3.   

    建议你将路径写在web.config里,然后读出来
    在web.config里加上
    <MySetting>
       <add  key="dataPath" value="c:\\interpub\\project\\dada\\resistance.mdb"
    </MySetting>文件中读:private static string path= ConfigurationSettings.AppSettings["dataPath"];
      

  4.   

    web 程序很好用的
    同上!
      

  5.   

    Server.MapPath(".")+"\data\resistance.mdb"
      

  6.   

    有一个函数也许对你有用,request.ApplicationPath(),返回你的虚拟目录的路径,然后可以把它map成物理路径。