打开连接时连接到Access数据库的问题

时间:2018-07-24 19:45:41

标签: database access

我正在尝试连接到访问数据库。打开连接时将弹出此错误。这是代码,抱歉,如果很难阅读

        try
        {
            connection.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=N:\Planning Calendar\Planning Calender.accdb;
                                        Persist Security Info=False;";
            connection.Open();
            OleDbCommand command = new OleDbCommand();
            command.Connection = connection;
            command.CommandText = "INSERT INTO...;
            command.ExecuteNonQuery();
            MessageBox.Show("Data submitted");
            connection.Close();
        }
        catch (Exception ex)
        {
            MessageBox.Show("Error" + ex);
        }

0 个答案:

没有答案