Solved

Operation must use an updateable query

Posted on 2009-05-10
14
782 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
  • 7
  • 4
  • 2
  • +1
14 Comments
 
LVL 8

Expert Comment

by:SNilsson
Comment Utility
0
 
LVL 65

Expert Comment

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

0
 
LVL 8

Author Comment

by:johny_bravo1
Comment Utility
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
 
LVL 65

Expert Comment

by:rockiroads
Comment Utility
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
Comment Utility
actually it works fine on local machine but not on web server.

0
 
LVL 10

Expert Comment

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

Author Comment

by:johny_bravo1
Comment Utility
on the server????
Well I have uploaded the same mdb on the server.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 8

Author Comment

by:johny_bravo1
Comment Utility
0
 
LVL 65

Expert Comment

by:rockiroads
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Ok I'll post back if anything is updated
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now