Problem with MDB file in Asp.Net application

I have been using Microsoft Access database to store some infrequently changed information for quite some time. It worked well until recently I began to use GoDaddy Hosting plan.

I uploaded my application to my GoDaddy hosting server, made some changes online, and downloaded to my local development environment because I noticed that the online change did not work as I expected.

With some debug, I found that I got a strange exception with all update SQL statement.

System.Data.OleDb.OleDbException was caught
Message="Operation must use an updateable query."
Source="Microsoft JET Database Engine"
ErrorCode=-2147467259
StackTrace:
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr)
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()

I did some search online and found that it looks most likely a write permission issue to the MDB file. I checked the property of my downloaded mdb file and found it was changed to "ReadOnly". After I turned off the "Readonly" property of the file, the exception disappear immediately. I then realized that GoDaddy hosting server might have change the file property for me.

After calling GoDaddy technique support, I was told that by default my App_Data folder was read only and I could change the folder permission online myself.

Followed the instruction of the nice technique support, I logged into my GoDaddy account, chose to manage my hosting account, and in the Host Control Center webpage, click the "Your Files" tab which is the first link button. Now I was in the file manager page of GoDaddy and could easily change write permission for any of my file folders.

However, the problem still existed. Even after I changed the folder to writable, and the mdb file is writable now, I still can not run my update statement. After I download the file to my local, the file becomes "read only" again.

I then managed to write a XML file in the folder and noticed that even though the XML file is also Readonly, I am able to overwrite the file.

It looks that GoDaddy is still limiting the MDB file writing permission. But for other files they are OK.

Comments

  1. I know many other tools. But yesterday no one of theirs couldn't help me with corrupted access files. Fortunately later I found in the Internet - MDB Recovery. It resolved my trouble for a minute and free of charge as I kept in mind. Moreover the utility helped some of my friends too.

    ReplyDelete
  2. Are you trying to make money from your visitors with popup ads?
    In case you do, have you ever consider using EroAdvertising?

    ReplyDelete

Post a Comment

Popular posts from this blog

Javascript Hosted on Google Drive Not Working Reliably

Newsmag Theme and External Featured Image

Responsive Web Design