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()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 updateabl
e
> 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()
>
>
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 updateabl
e
> 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()
>
>
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" <PatrickOIge@.discussions.microsoft.com> wrote in message
news:28E8342A-7D74-486C-A5AE-68B9AF3D8993@.microsoft.com...
> It could be a permission problem!
> Make sure u have full right to the MDB file or the Directory!
> GDLUCK
> "John" wrote:
>
updateable
values I
the
& _
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
Saturday, March 24, 2012
Operation must use an updateable query.
Labels:
0x80004005,
asp,
below,
code,
error,
executenonquery,
hii,
net,
oledbexception,
operation,
query,
updateable,
updateablequery
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment