Error:Operation must use an updateable query

G

Guest

Hi
I am getting the 'Operation must use an updateable query' error when i am trying to insert some data into the access db!
I have checked for the permissions, all the permissions are ok, at the same time i also changed the settings in machinge.config file from 'machine' to 'SYSTEM'. Any other ideas of why it gives that error, this is the code

Dim sPath As String = Server.MapPath("db/dbname.mdb"
sConn = "Provider=Microsoft.Jet.OLEDB.4.0;
sConn +="DATA Source=" & sPath & ";
sConn += "Persist Security Info=False
oConn = New OleDbConnection(sConn

strinsert="insert into dattbl_movies(type,genre,title,rating) values(?,?,?,?)
cmdinsert=New OledbCOmmand(strinsert,oConn)
cmdinsert.Parameters.Add("@type",rdtype.SelectedValue
cmdinsert.Parameters.Add("@genre",txtgenre.text
cmdinsert.Parameters.Add("@title",txttitle.text
cmdinsert.Parameters.Add("@rating",txtrating.text)
oConn.Open(
cmdinsert.ExecuteNonQuery(
oConn.Close(

Thanks in advance

Ken
 
T

Teemu Keiski

Hi,

It is all about the correct user (ASPNET or something else depending on your
settings) having read/write permissions to the folder where access database
file (mdb) resides. Take a look at this thread at ASP.NEt Forums.

http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=154273

Pay attention to the KB mentioned in my (first) post.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

Hi,
I am getting the 'Operation must use an updateable query' error when i am
trying to insert some data into the access db!!
I have checked for the permissions, all the permissions are ok, at the same
time i also changed the settings in machinge.config file from 'machine' to
'SYSTEM'. Any other ideas of why it gives that error, this is the code:

Dim sPath As String = Server.MapPath("db/dbname.mdb")
sConn = "Provider=Microsoft.Jet.OLEDB.4.0;"
sConn +="DATA Source=" & sPath & ";"
sConn += "Persist Security Info=False"
oConn = New OleDbConnection(sConn)

strinsert="insert into dattbl_movies(type,genre,title,rating)
values(?,?,?,?)"
cmdinsert=New OledbCOmmand(strinsert,oConn)
cmdinsert.Parameters.Add("@type",rdtype.SelectedValue)
cmdinsert.Parameters.Add("@genre",txtgenre.text)
cmdinsert.Parameters.Add("@title",txttitle.text)
cmdinsert.Parameters.Add("@rating",txtrating.text)
oConn.Open()
cmdinsert.ExecuteNonQuery()
oConn.Close()


Thanks in advance.

Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top