am unable to write into the table of MS access file in godaddy(works in localhost).....is their any settings that needs to be changed???
Dim MySQL As String = "Insert into mainregistration (name,usernamee,passwordd,college,department,yearr,emailid,contactno) " & _
"Values (@name,@usernamee,@passwordd,@college,@department,@yearr,@emailid,@contactno)"
Dim MyConn As New OleDbConnection(strConn)
Dim Cmd As New OleDbCommand(MySQL, MyConn)
With Cmd.Parameters
.Add(New OleDbParameter("@name", name.Text))
.Add(New OleDbParameter("@usernamee", username.Text))
.Add(New OleDbParameter("@passwordd", password.Text))
.Add(New OleDbParameter("@college", college.SelectedValue))
.Add(New OleDbParameter("@department", department.SelectedValue))
.Add(New OleDbParameter("@yearr", year.SelectedValue))
.Add(New OleDbParameter("@emailid", emailid.Text))
.Add(New OleDbParameter("@contactno", contactno.Text))
End With
MyConn.Open()
Cmd.ExecuteNonQuery()
MyConn.Close()
Operation must use an updateable query.
Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: Operation must use an updateable query.
Source Error:
Line 34: Line 35: MyConn.Open() Line 36: Cmd.ExecuteNonQuery() Line 37: MyConn.Close() Line 38:
Hi,
i don't know whether you will agree ,but i have experienced this error hell lots of times,but after doing some R & D,I found there can be so many reasons for it,
like
1. if you will Right click on MsAccess,you will see this file in Read Only mode,so you need to remove Read only checkbox
2. may be your MsAccess in workGroup and you don't have write permissions,fine you can just make sure that your MsAccess is in standalone modei mean
Any user who opens the Access database for update must have full permissions to the
folder where the database is located. This is so the Jet database engine can create, update and delete the corresponding .LDB file that is used to track user access to the database.
.
difficult to recall every point,just try with this,if still it doesn't work let me know,i will give you some other solutions
I don't know whether you can set permissions on GoDaddy. You should ask them whether you can do that yourself or if they can do that for you. In shared hosting, sometimes there's a special map for Access Databases, ussualy outside the webroot.
just use below code.only thing i want you to check whether your access database has read only checkbox unchecked and make sure folder in which msaccess resides have read write permission
And when you want to Execute an Insert, use ExecuteNonQuery, instead of ExecuteScalar. And when you want to insert a date without using parameters. you need to enclose them in #, not in ´, which is used for strings...
Member
11 Points
54 Posts
Ms access and go daddy
Jun 20, 2009 12:57 AM|bkamalnivas|LINK
am unable to write into the table of MS access file in godaddy(works in localhost).....is their any settings that needs to be changed???
Dim MySQL As String = "Insert into mainregistration (name,usernamee,passwordd,college,department,yearr,emailid,contactno) " & _
"Values (@name,@usernamee,@passwordd,@college,@department,@yearr,@emailid,@contactno)"
Dim MyConn As New OleDbConnection(strConn)
Dim Cmd As New OleDbCommand(MySQL, MyConn)
With Cmd.Parameters
.Add(New OleDbParameter("@name", name.Text))
.Add(New OleDbParameter("@usernamee", username.Text))
.Add(New OleDbParameter("@passwordd", password.Text))
.Add(New OleDbParameter("@college", college.SelectedValue))
.Add(New OleDbParameter("@department", department.SelectedValue))
.Add(New OleDbParameter("@yearr", year.SelectedValue))
.Add(New OleDbParameter("@emailid", emailid.Text))
.Add(New OleDbParameter("@contactno", contactno.Text))
End With
MyConn.Open()
Cmd.ExecuteNonQuery()
MyConn.Close()
Operation must use an updateable query.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.Data.OleDb.OleDbException: Operation must use an updateable query.
Source Error:
This is the error i get....need help....thanx
Star
10830 Points
2409 Posts
Re: Ms access and go daddy
Jun 22, 2009 01:52 AM|shabirhakim1|LINK
Hi,
i don't know whether you will agree ,but i have experienced this error hell lots of times,but after doing some R & D,I found there can be so many reasons for it,
like
1. if you will Right click on MsAccess,you will see this file in Read Only mode,so you need to remove Read only checkbox
2. may be your MsAccess in workGroup and you don't have write permissions,fine you can just make sure that your MsAccess is in standalone modei mean Any user who opens the Access database for update must have full permissions to the folder where the database is located. This is so the Jet database engine can create, update and delete the corresponding .LDB file that is used to track user access to the database.
.
difficult to recall every point,just try with this,if still it doesn't work let me know,i will give you some other solutions
Thanks
shabir hakim
All-Star
25756 Points
7014 Posts
Re: Ms access and go daddy
Jun 22, 2009 02:59 AM|hans_v|LINK
http://www.mikesdotnetting.com/Article.aspx?ArticleID=74
I don't know whether you can set permissions on GoDaddy. You should ask them whether you can do that yourself or if they can do that for you. In shared hosting, sometimes there's a special map for Access Databases, ussualy outside the webroot.
Star
10830 Points
2409 Posts
Re: Ms access and go daddy
Jun 22, 2009 05:02 AM|shabirhakim1|LINK
Hey Great Man
just use below code.only thing i want you to check whether your access database has read only checkbox unchecked and make sure folder in which msaccess resides have read write permission
just replace my fiels with yours....
/////////////////html content file///////////
All-Star
25756 Points
7014 Posts
Re: Ms access and go daddy
Jun 22, 2009 09:02 AM|hans_v|LINK
No, you need MODIFY permissions on the folder. Instead of all the research, read the link I provided in my previous post!
And maybe you should do also somes research on SQL injections and Parameterized Queries.
http://www.mikesdotnetting.com/Article.aspx?ArticleID=26
And when you want to Execute an Insert, use ExecuteNonQuery, instead of ExecuteScalar. And when you want to insert a date without using parameters. you need to enclose them in #, not in ´, which is used for strings...
Member
11 Points
54 Posts
Re: Ms access and go daddy
Jun 23, 2009 01:58 AM|bkamalnivas|LINK
Thank u shabir