我正在尝试从C#连接到Access数据库,但它返回错误。
我正在尝试通过关注this thread来解决,但它无效。
你能告诉我哪里出错了吗?
connection_string =@"Provider=Microsoft.ACE.OLEDB.12.0;Password=pass@word1;Location=C:\Users\manoj\Documents\manoj\Databases\college.accdb;Persist Security Info=True;";
错误是:
多步OLE DB操作生成错误。检查每个OLE DB状态值(如果可用)。没有工作。
答案 0 :(得分:1)
您收到错误,因为Location=
不是OLEDB连接字符串的有效参数。您需要使用Data Source=
,而不是
... ;Data Source=C:\Users\manoj\Documents\manoj\Databases\college.accdb; ...