错误:访问数据库时找不到文件C: [英] Error : could not find file C: while accessing database

查看:129
本文介绍了错误:访问数据库时找不到文件C:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到的当前问题是一条错误消息,它无法找到文件C:现在我不知道问题是什么,因为该文件位于该位置。我曾尝试过.accbd和.mbd。

The current problem I'm having is an error message that it could not find file C: now I dont know what the problem is because the file is in that location. I have I tried in both .accbd and .mbd.

 private static OleDbConnection GetConnection()
{
    OleDbConnection conn = new OleDbConnection();
    String connectionString = @"Provider=Microsoft.JET.OlEDB.4.0;"
                              + @"Data Source= C:\Temp\F1\Docs\ExpeditorsProject\Table1.accbd";
    conn = new OleDbConnection(connectionString);
    conn.Open();
    return conn;
}

推荐答案

确保该位置存在数据库。

另外,有关连接字符串的更多帮助,请尝试访问连接字符串 - ConnectionStrings.com [ ^ ]。
Make sure database exist in the location.
Additionally, for more help on connection strings, try Access connection strings - ConnectionStrings.com[^].


错误清除显示该路径上不存在该文件。请检查指定的路径,看看它是否真的存在。
Error clear shows the file is not exist on said path. Please check for the specified path and see if it really exist.


得到的答案与位置无关,因为我已经声明该文件位于那里

Got the answer it had nothing to do with the location because as I have stated that the file is located there
Provider=Microsoft.ACE.OLEDB.12.0;
 
Data Source=C:\Temp\F1\Docs\Expeditors Project\Table1.accbd;


这篇关于错误:访问数据库时找不到文件C:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆