必须使用可更新的查询 [英] Must Use Updateable Query

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

问题描述

问题 - 当我尝试对Access数据库运行INSERT查询

时,我一直收到上述错误。我正在运行XP Professional和VS.NET 2003.我

整天从ASP.NET运行SELECT查询,当我运行

INSERT查询时在Access本身,它工作正常。但出于某种原因,当我从ASP.NET中运行它时,我得到了必须使用可更新的查询。错误。

我尝试过搜索,并尝试在

目录上设置权限尽可能宽松。还有其他安全设置

我不见了?或者与我的查询不兼容?或者其他一些

问题?


TIA。


这是我的代码:


Dim Con As New OleDb.OleDbConnection

(" PROVIDER =" Microsoft.Jet.OLEDB.4.0; DATA

SOURCE =" ;" C:\ InetPub \ www.root \ Test1 \STORE.MDB"" ;; USER ID = Admin; PASSWORD =;")

Con.Open()

Dim Cmd作为新OleDb.OleDbCommand(INSERT INTO [tblOrder]([CustomerID],

[小计],[Tax],[Discount],[ShippingMethod],[ ShippingCost],[Total],

[OrderDate],[ShipName],[ShipAddress],[ShipCity],[ShipState],[ShipZIP],

[CCNum] ,[CCExp])VALUES(6,190,10.2885,9.5,"" Express",10,200.7885,

"" 1/15/2005 9:53:29 PM","" Joe Mocling","""",""&"""""""""""""""" ,

"""","" 1/1/2005 12: 00:00 AM"")",Con)

Cmd.ExecuteNonQuery()

Cmd.Dispose()

Con.Close ()

Cmd.Dispose()

Question - I keep getting the above error when I try to run an INSERT query
against an Access database. I''m running XP Professional and VS.NET 2003. I
run SELECT queries from ASP.NET against it all day long, and when I run the
INSERT query inside Access itself, it works fine. But for some reason when
I run it from within ASP.NET, I get the "Must Use Updateable Query" error.
I''ve tried searching and have also tried setting the permissions on the
directory to be as liberal as possible. Is there another security setting
I''m missing? Or is there an incompatibility with my query? Or some other
problem?

TIA.

Here''s my code:

Dim Con As New OleDb.OleDbConnection
("PROVIDER="Microsoft.Jet.OLEDB.4.0;DATA
SOURCE=""C:\InetPub\wwwroot\Test1\STORE.MDB"";USER ID=Admin;PASSWORD=;")
Con.Open()
Dim Cmd As New OleDb.OleDbCommand("INSERT INTO [tblOrder] ([CustomerID],
[Subtotal], [Tax], [Discount], [ShippingMethod], [ShippingCost], [Total],
[OrderDate], [ShipName], [ShipAddress], [ShipCity], [ShipState], [ShipZIP],
[CCNum], [CCExp]) VALUES (6, 190, 10.2885, 9.5, ""Express"", 10, 200.7885,
""1/15/2005 9:53:29 PM"", ""Joe Mocling"", """", ""Atlanta"", ""GA"", """",
"""", ""1/1/2005 12:00:00 AM"")", Con)
Cmd.ExecuteNonQuery()
Cmd.Dispose()
Con.Close()
Cmd.Dispose()

推荐答案

嗨迈克尔,


这通常是由当前用户引起的 - ASP.NET在.mdb文件所在的目录中没有足够的

权限。访问需要

在运行时创建一个锁定文件...这需要对文件和目录进行更改权限



http://support.microsoft.com/default。 ..b; en-us; 316675

" Michael C#" < xy*@abcdef.com>在留言中写道

新闻:8Z ***************** @ fe08.lga ...
Hi Michael,

This is usually caused by the current user - ASP.NET not having sufficient
privileges in the directory where the .mdb file is located. Access needs to
create a locking file when it is run... that requires change permissions on
the file and directory.

http://support.microsoft.com/default...b;en-us;316675
"Michael C#" <xy*@abcdef.com> wrote in message
news:8Z*****************@fe08.lga...
问题 - 我保留当我尝试对Access数据库运行INSERT
查询时收到上述错误。我正在运行XP Professional和VS.NET
2003.我整天都在运行来自ASP.NET的SELECT查询,当我在Access中运行INSERT查询时,它运行正常。但是出于某种原因,当我在ASP.NET中运行它时,我得到了必须使用可更新的查询。错误。我尝试过搜索,并尝试在目录上设置
权限尽可能宽松。是否有其他安全设置我不见了?或者与我的查询不兼容?还是其他一些问题?

TIA。

这是我的代码:

Dim Con As New OleDb.OleDbConnection
( PROVIDER =Microsoft.Jet.OLEDB.4.0; DATA
SOURCE ="" C:\ InetPub \ www.root \ Test1 \STORE.MDB"" ;; USER ID = Admin; PASSWORD =;")
Con.Open()
Dim Cmd As New OleDb.OleDbCommand(" INSERT INTO [tblOrder]([CustomerID],
[Subtotal],[Tax] ,[折扣],[ShippingMethod],[ShippingCost],[Total],
[OrderDate],[ShipName],[ShipAddress],[ShipCity],[ShipState],
[ShipZIP],[ CCNum],[CCExp])VALUES(6,190,10.2885,9.5,"" Express",
10,200.7885,"" 1/15/2005 9:53:29 PM" ","" Joe Mocling"","""",
""" Atlanta","""" GA""""" ","""","" 1/1/2005 12:00:00 AM"")",Con)
Cmd.ExecuteNonQuery()
Cmd .Di spose()
Con.Close()
Cmd.Dispose()
Question - I keep getting the above error when I try to run an INSERT
query against an Access database. I''m running XP Professional and VS.NET
2003. I run SELECT queries from ASP.NET against it all day long, and when
I run the INSERT query inside Access itself, it works fine. But for some
reason when I run it from within ASP.NET, I get the "Must Use Updateable
Query" error. I''ve tried searching and have also tried setting the
permissions on the directory to be as liberal as possible. Is there
another security setting I''m missing? Or is there an incompatibility with
my query? Or some other problem?

TIA.

Here''s my code:

Dim Con As New OleDb.OleDbConnection
("PROVIDER="Microsoft.Jet.OLEDB.4.0;DATA
SOURCE=""C:\InetPub\wwwroot\Test1\STORE.MDB"";USER ID=Admin;PASSWORD=;")
Con.Open()
Dim Cmd As New OleDb.OleDbCommand("INSERT INTO [tblOrder] ([CustomerID],
[Subtotal], [Tax], [Discount], [ShippingMethod], [ShippingCost], [Total],
[OrderDate], [ShipName], [ShipAddress], [ShipCity], [ShipState],
[ShipZIP], [CCNum], [CCExp]) VALUES (6, 190, 10.2885, 9.5, ""Express"",
10, 200.7885, ""1/15/2005 9:53:29 PM"", ""Joe Mocling"", """",
""Atlanta"", ""GA"", """", """", ""1/1/2005 12:00:00 AM"")", Con)
Cmd.ExecuteNonQuery()
Cmd.Dispose()
Con.Close()
Cmd.Dispose()






谢谢Ken,我发现链接上一次搜索。我已经在这个盒子和web目录上配置了

设置尽可能宽松,但

似乎没什么用。我已将IIS中的安全设置更改为

允许所有内容甚至授予IUSR_管理员权限,以查看是否存在问题。在Windows资源管理器中的文件夹属性框中,

我已经允许了所有内容!


我遗漏了哪些安全设置以及世界上的安全设置我将它们设置为

XP专业版?


谢谢


" Ken Cox [Microsoft MVP]" < BA ************ @ sympatico.ca>在消息中写道

news:ue **************** @ TK2MSFTNGP12.phx.gbl ...
Thanks Ken, I found that link on a previous search. I''ve configured the
settings on this box and the web directory to be as liberal as possible, but
nothing seems to be working. I''ve changed the security settings in IIS to
allow everything and even gave the IUSR_ Administrator rights to see if that
was an issue. On the properties box in Windows Explorer for the folder,
I''ve allowed everything!

What security settings am I missing and how in the world can I set them in
XP Pro?

Thanks

"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> wrote in message
news:ue****************@TK2MSFTNGP12.phx.gbl...
嗨Michael,

这通常是由当前用户引起的 - ASP.NET在.mdb文件所在的目录中没有足够的
权限。访问需要
在运行时创建锁定文件...这需要更改文件和目录的权限。

http://support.microsoft.com/default...b;en-us; 316675

" Michael C#" < xy*@abcdef.com>在消息中写道
新闻:8Z ***************** @ fe08.lga ...
Hi Michael,

This is usually caused by the current user - ASP.NET not having sufficient
privileges in the directory where the .mdb file is located. Access needs
to create a locking file when it is run... that requires change
permissions on the file and directory.

http://support.microsoft.com/default...b;en-us;316675
"Michael C#" <xy*@abcdef.com> wrote in message
news:8Z*****************@fe08.lga...
问题 - 我一直收到上述错误当我尝试对Access数据库运行INSERT
查询时。我正在运行XP Professional和VS.NET
2003.我整天都在运行来自ASP.NET的SELECT查询,而当我在Access中运行INSERT查询时,它运行正常。但是,当我从ASP.NET中运行它时,我得到了必须使用
可更新查询。错误。我尝试过搜索,并尝试将目录上的权限设置为尽可能宽松。是否有其他安全设置我不见了?或者我的查询是否存在不兼容性?还是其他一些问题?

TIA。

这是我的代码:

Dim Con As New OleDb.OleDbConnection
( PROVIDER =Microsoft.Jet.OLEDB.4.0; DATA
SOURCE ="" C:\ InetPub \ www.root \ Test1 \STORE.MDB"" ;; USER ID = Admin; PASSWORD =;")
Con.Open()
Dim Cmd As New OleDb.OleDbCommand(" INSERT INTO [tblOrder]([CustomerID],
[Subtotal],[Tax] ,[折扣],[ShippingMethod],[ShippingCost],[Total],
[OrderDate],[ShipName],[ShipAddress],[ShipCity],[ShipState],
[ShipZIP],[ CCNum],[CCExp])VALUES(6,190,10.2885,9.5,"" Express",
10,200.7885,"" 1/15/2005 9:53:29 PM" ","" Joe Mocling"","""",
""" Atlanta","""" GA""""" ","""","" 1/1/2005 12:00:00 AM"")",Con)
Cmd.ExecuteNonQuery()
Cmd .Di spose()
Con.Close()
Cmd.Dispose()
Question - I keep getting the above error when I try to run an INSERT
query against an Access database. I''m running XP Professional and VS.NET
2003. I run SELECT queries from ASP.NET against it all day long, and
when I run the INSERT query inside Access itself, it works fine. But for
some reason when I run it from within ASP.NET, I get the "Must Use
Updateable Query" error. I''ve tried searching and have also tried setting
the permissions on the directory to be as liberal as possible. Is there
another security setting I''m missing? Or is there an incompatibility
with my query? Or some other problem?

TIA.

Here''s my code:

Dim Con As New OleDb.OleDbConnection
("PROVIDER="Microsoft.Jet.OLEDB.4.0;DATA
SOURCE=""C:\InetPub\wwwroot\Test1\STORE.MDB"";USER ID=Admin;PASSWORD=;")
Con.Open()
Dim Cmd As New OleDb.OleDbCommand("INSERT INTO [tblOrder] ([CustomerID],
[Subtotal], [Tax], [Discount], [ShippingMethod], [ShippingCost], [Total],
[OrderDate], [ShipName], [ShipAddress], [ShipCity], [ShipState],
[ShipZIP], [CCNum], [CCExp]) VALUES (6, 190, 10.2885, 9.5, ""Express"",
10, 200.7885, ""1/15/2005 9:53:29 PM"", ""Joe Mocling"", """",
""Atlanta"", ""GA"", """", """", ""1/1/2005 12:00:00 AM"")", Con)
Cmd.ExecuteNonQuery()
Cmd.Dispose()
Con.Close()
Cmd.Dispose()



Michael,


您必须提供读取/更改/写入的帐户

权限是ASPNET帐户,而不是

IUSR_ Administrator和IUSR_ MachineName帐号。


请确保您不仅仅通过.mdb文件授予这些权利。


您需要将这些权利授予ASPNET帐户
$ *
在*目录*中Access .mdb文件所在的位置。


Juan T. Llibre

ASP.NET MVP

===========

" Michael C#" < xy*@abcdef.com>在消息中写道

新闻:GA ***************** @ fe08.lga ...
Michael,

The account that you must give read/change/write
permissions to is the ASPNET account, not the
IUSR_ Administrator nor the IUSR_ MachineName account.

Make sure you don''t only give those rights over the .mdb file.

You need to give those rights to the ASPNET account
over the *directory* where the Access .mdb file is located.


Juan T. Llibre
ASP.NET MVP
===========
"Michael C#" <xy*@abcdef.com> wrote in message
news:GA*****************@fe08.lga...
谢谢肯,我发现以前搜索的链接。我已经在这个盒子和web目录上配置了
设置尽可能自由,
但似乎没有任何效果。我已经改变了IIS中的安全设置以允许所有内容,甚至赋予IUSR_管理员权限
看看这是否是一个问题。在Windows资源管理器中的属性框中,我已经允许了所有内容!

我缺少哪些安全设置以及如何在世界中设置它们
XP专业版吗?

  Ken Cox [Microsoft MVP]" < BA ************ @ sympatico.ca>在消息中写道
新闻:ue **************** @ TK2MSFTNGP12.phx.gbl ...
Thanks Ken, I found that link on a previous search. I''ve configured the
settings on this box and the web directory to be as liberal as possible,
but nothing seems to be working. I''ve changed the security settings in
IIS to allow everything and even gave the IUSR_ Administrator rights to
see if that was an issue. On the properties box in Windows Explorer for
the folder, I''ve allowed everything!

What security settings am I missing and how in the world can I set them in
XP Pro?

Thanks

"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> wrote in message
news:ue****************@TK2MSFTNGP12.phx.gbl...
嗨迈克尔,

这通常是由当前用户引起的 - ASP.NET在.mdb文件所在的目录中没有足够的权限。
访问需要在运行时创建锁定文件...需要对文件和目录进行更改权限。

http://support.microsoft.com/default...b;en-us;316675

" Michael C#" < xy*@abcdef.com>在消息中写道
新闻:8Z ***************** @ fe08.lga ...
Hi Michael,

This is usually caused by the current user - ASP.NET not having
sufficient privileges in the directory where the .mdb file is located.
Access needs to create a locking file when it is run... that requires
change permissions on the file and directory.

http://support.microsoft.com/default...b;en-us;316675
"Michael C#" <xy*@abcdef.com> wrote in message
news:8Z*****************@fe08.lga...
问题 - 我一直收到上述错误当我尝试对Access数据库运行INSERT
查询时。我正在运行XP Professional和
VS.NET 2003.我整天都在运行来自ASP.NET的SELECT查询,
当我在Access中运行INSERT查询时,它运行正常。
但是出于某种原因,当我在ASP.NET中运行它时,我得到了必须使用可更新的查询。错误。我已经尝试过搜索,并且还尝试将目录上的权限设置为尽可能宽松。
是否有其他安全设置我不见了?或者是否与我的查询不兼容?还是其他一些问题?

TIA。

这是我的代码:

Dim Con As New OleDb.OleDbConnection
( PROVIDER =Microsoft.Jet.OLEDB.4.0; DATA
SOURCE ="" C:\ InetPub \ www.root \ Test1 \STORE.MDB"" ;; USER ID = Admin; PASSWORD =;")
Con.Open()
Dim Cmd As New OleDb.OleDbCommand(" INSERT INTO [tblOrder]([CustomerID],
[Subtotal],[Tax] ,[折扣],[ShippingMethod],[ShippingCost],
[Total],[OrderDate],[ShipName],[ShipAddress],[ShipCity],
[ShipState],[ShipZIP],[ CCNum],[CCExp])VALUES(6,190,10.2885,9.5,
"" Express"",10,200.7885,"" 1/15/2005 9:53:29 PM" ","" Joe Mocling"",
"""",""" Atlanta"""""" GA""""" ","""","" 1/1/2005 12:00:00 AM"")",Con)
Cmd.ExecuteNonQuery()
Cmd .Di spose()
Con.Close()
Cmd.Dispose()
Question - I keep getting the above error when I try to run an INSERT
query against an Access database. I''m running XP Professional and
VS.NET 2003. I run SELECT queries from ASP.NET against it all day long,
and when I run the INSERT query inside Access itself, it works fine.
But for some reason when I run it from within ASP.NET, I get the "Must
Use Updateable Query" error. I''ve tried searching and have also tried
setting the permissions on the directory to be as liberal as possible.
Is there another security setting I''m missing? Or is there an
incompatibility with my query? Or some other problem?

TIA.

Here''s my code:

Dim Con As New OleDb.OleDbConnection
("PROVIDER="Microsoft.Jet.OLEDB.4.0;DATA
SOURCE=""C:\InetPub\wwwroot\Test1\STORE.MDB"";USER ID=Admin;PASSWORD=;")
Con.Open()
Dim Cmd As New OleDb.OleDbCommand("INSERT INTO [tblOrder] ([CustomerID],
[Subtotal], [Tax], [Discount], [ShippingMethod], [ShippingCost],
[Total], [OrderDate], [ShipName], [ShipAddress], [ShipCity],
[ShipState], [ShipZIP], [CCNum], [CCExp]) VALUES (6, 190, 10.2885, 9.5,
""Express"", 10, 200.7885, ""1/15/2005 9:53:29 PM"", ""Joe Mocling"",
"""", ""Atlanta"", ""GA"", """", """", ""1/1/2005 12:00:00 AM"")", Con)
Cmd.ExecuteNonQuery()
Cmd.Dispose()
Con.Close()
Cmd.Dispose()




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

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