Operation must use an updateable query

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?
LVL 8
Johny BravoAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
rockiroadsConnect With a Mentor Commented:
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
 
SNilssonCommented:
0
 
rockiroadsCommented:
can u post the sql ? does your sql include a select using aggregate functions or something?

0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Johny BravoAuthor Commented:
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
 
rockiroadsCommented:
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
 
Johny BravoAuthor Commented:
actually it works fine on local machine but not on web server.

0
 
EspavoCommented:
Does your Access DB have Read and Write permissions on the server?
0
 
Johny BravoAuthor Commented:
on the server????
Well I have uploaded the same mdb on the server.
0
 
Johny BravoAuthor Commented:
0
 
rockiroadsCommented:
if it works on your box then sounds like permissions. did u look a bit more at the last link I gave?
0
 
Johny BravoAuthor Commented:
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
 
Johny BravoAuthor Commented:
Ok I am not getting that Security tab on the FTP  but I am getting it on my machine.
0
 
EspavoConnect With a Mentor Commented:
You may need to contact the Server Administrator and ask him/her to enable Write permissions (full permissions) on your .MDB
0
 
Johny BravoAuthor Commented:
Ok I'll post back if anything is updated
0
All Courses

From novice to tech pro — start learning today.