Operation must use an updateable query.

J

John

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()
 
G

Guest

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

Guest

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
 
J

John

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 said:
It could be a permission problem!
Make sure u have full right to the MDB file or the Directory!
GDLUCK

John said:
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()
 
H

Hans Kesting

John said:
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
 

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

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top