By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,966 Members | 2,054 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,966 IT Pros & Developers. It's quick & easy.

Operation must use an updateable query.

P: n/a
Hi

I am getting [OleDbException (0x80004005): Operation must use an updateable
query.] error on ExecuteNonQuery() . Full code is given below. The values I
have given are; ('trtrt', 'retret', '1/1/2', '333'). Any idea what is the
problem?

Thanks

Regards

Dim sSQL As String = "INSERT into Applications (forenames, surname, dob,
[number]) " & _
"VALUES ('" & txtForenames.Text & "', '" & txtSurname.Text & "', '" &
txtDOB.Text & "', '" & txtNumber.Text & "')"
' Response.Write(sSQL)
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath("/") + "Staff_Application/Staff_Application.mdb" & ";"
Dim MyConn As New OleDbConnection(strConn)
Dim cmd As New OleDbCommand(sSQL, MyConn)
MyConn.Open()
cmd.ExecuteNonQuery() '<=== This line gives the error.
MyConn.Close()
Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
It could be a permission problem!
Make sure u have full right to the MDB file or the Directory!
GDLUCK

"John" wrote:
Hi

I am getting [OleDbException (0x80004005): Operation must use an updateable
query.] error on ExecuteNonQuery() . Full code is given below. The values I
have given are; ('trtrt', 'retret', '1/1/2', '333'). Any idea what is the
problem?

Thanks

Regards

Dim sSQL As String = "INSERT into Applications (forenames, surname, dob,
[number]) " & _
"VALUES ('" & txtForenames.Text & "', '" & txtSurname.Text & "', '" &
txtDOB.Text & "', '" & txtNumber.Text & "')"
' Response.Write(sSQL)
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath("/") + "Staff_Application/Staff_Application.mdb" & ";"
Dim MyConn As New OleDbConnection(strConn)
Dim cmd As New OleDbCommand(sSQL, MyConn)
MyConn.Open()
cmd.ExecuteNonQuery() '<=== This line gives the error.
MyConn.Close()

Nov 18 '05 #2

P: n/a
HI John,
It could be a permission problem.
Make sure u have FULL right on the MDB file or the Directory!
Or u could close ur Access before running the page:)
GDLUCK

"John" wrote:
Hi

I am getting [OleDbException (0x80004005): Operation must use an updateable
query.] error on ExecuteNonQuery() . Full code is given below. The values I
have given are; ('trtrt', 'retret', '1/1/2', '333'). Any idea what is the
problem?

Thanks

Regards

Dim sSQL As String = "INSERT into Applications (forenames, surname, dob,
[number]) " & _
"VALUES ('" & txtForenames.Text & "', '" & txtSurname.Text & "', '" &
txtDOB.Text & "', '" & txtNumber.Text & "')"
' Response.Write(sSQL)
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath("/") + "Staff_Application/Staff_Application.mdb" & ";"
Dim MyConn As New OleDbConnection(strConn)
Dim cmd As New OleDbCommand(sSQL, MyConn)
MyConn.Open()
cmd.ExecuteNonQuery() '<=== This line gives the error.
MyConn.Close()

Nov 18 '05 #3

P: n/a
John wrote:
I have right clicked on app folder under 'my default web' under
'Internet Information Services', selected 'Permissions Wizard' and
given the default permissions. Still no luck. What else can I try?
The machine is win xp pro.

Thanks

Regards


You have to set permissions on the file system, not (just) IIS.
At least the mdb file must be writable for the aspnet-user,
(the account the aspnet process runs under)
maybe the directory also.

Hans Kesting
Nov 18 '05 #4

P: n/a
I have right clicked on app folder under 'my default web' under 'Internet
Information Services', selected 'Permissions Wizard' and given the default
permissions. Still no luck. What else can I try? The machine is win xp pro.

Thanks

Regards
"Patrick.O.Ige" <Pa*********@discussions.microsoft.com> wrote in message
news:28**********************************@microsof t.com...
It could be a permission problem!
Make sure u have full right to the MDB file or the Directory!
GDLUCK

"John" wrote:
Hi

I am getting [OleDbException (0x80004005): Operation must use an updateable query.] error on ExecuteNonQuery() . Full code is given below. The values I have given are; ('trtrt', 'retret', '1/1/2', '333'). Any idea what is the problem?

Thanks

Regards

Dim sSQL As String = "INSERT into Applications (forenames, surname, dob,
[number]) " & _
"VALUES ('" & txtForenames.Text & "', '" & txtSurname.Text & "', '" &
txtDOB.Text & "', '" & txtNumber.Text & "')"
' Response.Write(sSQL)
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _ Server.MapPath("/") + "Staff_Application/Staff_Application.mdb" & ";"
Dim MyConn As New OleDbConnection(strConn)
Dim cmd As New OleDbCommand(sSQL, MyConn)
MyConn.Open()
cmd.ExecuteNonQuery() '<=== This line gives the error.
MyConn.Close()

Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.