不明白lz哪里遇到困难了简单点,你直接在你的链接字符串里面的数据库文件那里填上你的mdb文件名即可,别的不要改
运行的时候,只要保证你的mdb文件跟你的exe文件在一个目录就可以了

解决方案 »

  1.   

    可以把数据库文件放在bin\debug目录下或子目录下,然后这样来访问:
    Application.ExecutablePath + "\1.mdb"
      

  2.   

    呵呵,楼上快,我也把路径写错成ExecutablePath 了,不好意思.
      

  3.   

    更正下:
    Application.StartupPath + @"\1.mdb";
      

  4.   

    TO: 呵呵,楼上快,我也把路径写错成ExecutablePath 了,不好意思.哈哈 终于抢在老兄前面一回
      

  5.   

    or try..using System.Text.RegularExpressions;string path=Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)+@"\1.mdb";
      

  6.   

    sorry..using System.Text.RegularExpressions;->>using System.Reflection;