?
Solved

Operation must use an updateable query

Posted on 2009-05-10
14
Medium Priority
?
786 Views
Last Modified: 2013-11-07
Hi,,
I am trying to insert  data in access table in my asp.net application.
Locally it is working fine but on my web server it is throwing the above exception.
What is the cause of this?
0
Comment
Question by:johny_bravo1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
  • 2
  • +1
14 Comments
 
LVL 8

Expert Comment

by:SNilsson
ID: 24347271
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 24347309
can u post the sql ? does your sql include a select using aggregate functions or something?

0
 
LVL 8

Author Comment

by:johny_bravo1
ID: 24347344
string connectionString = string.Format(ConfigurationSettings.AppSettings["myconn"], Server.MapPath(ConfigurationSettings.AppSettings["finddb"]));
        OleDbConnection con = new OleDbConnection(connectionString);
        con.Open();

        string name = this.txtName.Text;
        string cname = this.txtCompName.Text;
        string number1 = this.txtContactNumber.Value;
        string email1 = this.txtEmail.Text;
        string address = this.txtAddress.Text;

        string sqlinsert = "insert into MemberData (MName,CName,Number1,Email1,Address)values ('" + name + "','" + cname + "','" + number1 + "','" + email1 + "','" + address + "')";
        OleDbCommand cmdinsert = new OleDbCommand(sqlinsert, con);
        cmdinsert.ExecuteNonQuery();
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 65

Expert Comment

by:rockiroads
ID: 24347388
well from looking at your query, I cant see anything wrong with it

what datatype is Number1, is it text? if its numeric then remove the single quotes

 string sqlinsert = "insert into MemberData (MName,CName,Number1,Email1,Address)values ('" + name + "','" + cname + "'," + number1 + ",'" + email1 + "','" + address + "')";


Have u looked into using parameters ? have a look at how its done here http://aspnet101.com/aspnet101/tutorials.aspx?id=1

Also, look at this. It is talking about permissions http://forums.asp.net/t/154273.aspx
0
 
LVL 8

Author Comment

by:johny_bravo1
ID: 24347402
actually it works fine on local machine but not on web server.

0
 
LVL 10

Expert Comment

by:Espavo
ID: 24347403
Does your Access DB have Read and Write permissions on the server?
0
 
LVL 8

Author Comment

by:johny_bravo1
ID: 24347414
on the server????
Well I have uploaded the same mdb on the server.
0
 
LVL 8

Author Comment

by:johny_bravo1
ID: 24347416
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 24347425
if it works on your box then sounds like permissions. did u look a bit more at the last link I gave?
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 1200 total points
ID: 24347431
the instructions here http://forums.asp.net/t/1083195.aspx 

It's a permissions issue.  You have to apply Modify permissions to the ASPNET account on your Access database.  Right click on the file, select the Security tab, then Add to find the ASPNET account
0
 
LVL 8

Author Comment

by:johny_bravo1
ID: 24347435
ya but I am not authorised to do anything on web server.

It is a third party server.

I can create a DSN for access.That's it what I can do there.


0
 
LVL 8

Author Comment

by:johny_bravo1
ID: 24347448
Ok I am not getting that Security tab on the FTP  but I am getting it on my machine.
0
 
LVL 10

Assisted Solution

by:Espavo
Espavo earned 800 total points
ID: 24347459
You may need to contact the Server Administrator and ask him/her to enable Write permissions (full permissions) on your .MDB
0
 
LVL 8

Author Comment

by:johny_bravo1
ID: 24347518
Ok I'll post back if anything is updated
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Suggested Courses
Course of the Month12 days, 21 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question