Access DB:操作必须使用可更新的查询 [英] Access DB: Operation must use an updateable query

查看:94
本文介绍了Access DB:操作必须使用可更新的查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行ISS服务器,我的访问文件位于C:\ WCF \ Access \ 我正在使用此查询来插入一些内容:

I am running an ISS server, i have an access file located in C:\WCF\Access\ I am using this query to insert something:

@"INSERT INTO Arbejdsindsats (MedarYdelID, StartTid, SlutTid) VALUES ('" + medarYdelID + "', '" + startTid + "', '" + slutTid + "')";

完整代码是:

public String GemArbejdsIndsats(String medarYdelID, String startTid, String slutTid)
        {
            try{
            con.Open();
            String command = @"INSERT INTO Arbejdsindsats (MedarYdelID, StartTid, SlutTid) VALUES ('" + medarYdelID + "', '" + startTid + "', '" + slutTid + "')";
            cmd.CommandText = command;
            cmd.ExecuteNonQuery();
            con.Close();


                return "success: medarydelid: " + medarYdelID + " startTid: " + startTid + " slutTid: " + slutTid;
            } catch(Exception e)
                {
                    String k = e.Message;
                    return k;
                }
        }

问题是此错误:

操作必须使用可更新的查询

Operation must use an updateable query

当我在自己的计算机上进行本地测试时,它可以正常工作.只是不在IIS中.

When i test locally on my own machine, it works fine. Just not in the IIS.

奇怪的是,这里有一个laccdb文件.它不会消失.也许数据库已锁定,这就是为什么我无法更新它?

The weird thing is that there's a laccdb file. it wont go away. Maybe the database is locked and thats why i cant update it?

权限应该不是问题:

img http://img.ctrlv.in/50c0dbf8670d8.jpg

推荐答案

用户帐户必须能够写入文件及其所在的文件夹;它应该能够在文件夹中创建和删除文件. laccdb文件的存在并不一定意味着访问已锁定数据库.它的存在可能是多种情况下的结果,其中一种可能是用户帐户无权从该文件夹中删除文件.

The user account must be able to write to the files and to the folder in which they are located; it should be able to create and delete files in the folder. The presence of the laccdb file does not necessarily mean that access has locked the database. Its presence could be the result of any of several circumstances, one of which could be that the user account doesn't have permission to delete files from the folder.

这篇关于Access DB:操作必须使用可更新的查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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