Solved

Operation must use an updateable query

Posted on 2009-05-10
14
785 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
The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

 
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 300 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 200 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

Turn Insights into Action

Communication across every corner of your business is essential to increase the velocity of your application delivery and support pipeline. Automate, standardize, and contextualize your communication processes with xMatters.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

717 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