PDA

View Full Version : "Updateable query" error... help!


krycek
03-10-2003, 04:49 AM
OK, I have been given a project to work on. I have downloaded the entire website I have to modify, with all its databases etc. I have got it working on my PC (stuck it in wwwroot of course) except for anything that tries to write to the databse, for example:

Error Type:
Microsoft JET Database Engine (0x80004005)
Operation must use an updateable query.
/incRecordEvent.asp, line 26

This is really annoying me; I have tried everything I can think of and so has whammy (he has the same problem with some of his work).

Does anyone know how to solve this, or what to do? I am running IIS 5 on WinXP Pro, the code uses Access DBs, no SQL Server or anything on my machine.

Any help is much appreciated - this is kinda urgent for me :(

::] krycek [::

webmarkart
03-10-2003, 07:00 AM
I've seen too much of the same error on one of my own sites lately. (my post (http://www.codingforums.com/showthread.php?s=&threadid=15882))

When I posted the same issue, Roy Sinclair posted this link:
http://search.microsoft.com/Default.asp?&so=RECCNT&boolean=ALL&siteid=us&p=1&nq=NEW&qu=%22Operation+must+use+an+updateable+query%22&IntlSearch=&ig=1&ig=2&ig=3&ig=4&ig=5&ig=6&ig=7&ig=8&ig=9&ig=10&i=00&i=01&i=02&i=03&i=04&i=05&i=06&i=07&i=08&i=09

it turns out in my case that its my hosting company's issue because when I uploaded it to another domain it worked perfectly. Unfortunately I know that doesn't help you but the link was helpful.

raf
03-10-2003, 09:24 AM
i've ran into this kind a problems, when i copied an Access db- from a machine with security user accounts on the databases.

i don't quite understand how it works (or what is does) but when you create user accounts in one access db, it applys this account system for all other db's (don't know why, but is does). Now, when you copy a db from this machine, and put it on another machine, then i get these kind a errors (even on db's that were already on this second machine) and even if there's no user account security on this second machine.

My quick fix has been to just copy all these db's. delete the original db's and then rename the copies (to the original names).

For some reason this cleared the problem for me.

Morgoth
03-10-2003, 09:51 AM
Well, before we get deeper into this, you all know what permissions are right?

You all know that inside of your server, there must either be the folder your database is in, or the database itself must be allowed to: Modify, and Write.

For an access database, it can have Modify and Write permissions set directly on it, but for something like a text file database, you might have to put it in a folder that has Modify and Write permissions.


These permissions are a security feature that is very safe, so if you wish to update, modify, or write to your database you will have to put it into the correct folder (where the admin of your hosting service told you to) or ask the admin to set modify, and write permissions directly to that file.

Do you all understand?

To Recap: krycek, webmarkart, and raf, you need to have permissions set to your files you want to be modified, or writen too.

raf
03-10-2003, 10:05 AM
that's indeed the most obvious cause, but i assume that Krycek, whammy etc have ruled that out.

i've had these errors on my machine and permissions were not the problem. i finely set up another db (copy with another name) and changed my SSI with the connectionstring in (only changed the name) and all of a sudden it worked.

Mysteriously. So i copyed and renemed all the db's (see previous post) and the problem was solved. (The app's where i opened the db in access all got that problem, but the apps on db's i didn't open in access kept running, until i opened the db in access ...)

whammy
03-11-2003, 02:02 AM
Hmm, I'll have to try that on my laptop.

I ran into the mysterious case of the _same_ blank Access database that I use on my personal website, and my PC (just fine, I might add), appearing to be "readonly" on my laptop (XP Pro with IIS 5), while I was able to read from and write to a text file in the same directory.

I have no idea what's causing that on my laptop (I did modify the write permissions in IIS to allow EVERYTHING, and double and triple checked the folder permissions in Explorer - although for some reason XP always sets ALL folder access to ReadOnly, no matter what you do?), and checked to make sure the database file itself was not "readonly")... I'm going to make another copy of the db and see if that helps.

This is probably something stupid that I overlooked, or it may be a mysterious MS bug as raf described, who knows. Whatever, it can definitely be frustrating - I don't understand what changed from Win ME(on my PC) to Win XP(on my laptop) that would cause this! ;)

Morgoth
03-11-2003, 04:53 AM
IF it were indeed a case with just having to rename your databases and copy them over, or something like that, it's still some sort of system error.

Now a days, having problem being fixed in ways that don't really make sence (like this way) you know there is a real way to fix it, and a real reason why it happened, I suggest you don't just do this to all your databases and be done with it, I suggest to try and make the error happen again, get all the information you can from that file (permissions too) and then do your trick. Compair the two, and boom, you problem is fixed!


I have a case which involves all files on my computer. If I CUT and paste a file form my (lets say) desktop, and put it in my wwwroot folder, it will ask me for a username and password that are from my computer, and will not allow you to access the file (good idea for databases, but I keep my important databases off server). But if I take that file, and copy it over into my wwwroot folder from (let's say, again) my desktop, it will not ask for username and password. It automatically assings the permissions for that file, so everyone can read it. Then if it was a database, I would just have to set the permissions so that everyone can modiy and edit the file.

So.. I lost track on my point, but you know.. CHEERS! (First time I ever said that) ;)

krycek
03-12-2003, 03:36 PM
OK, I have got nowhere so far :(

I tried the copy delete rename thing - nothing changed.

I haven't used ASP for ages, so I'm unsure about user accounts or grants or whatever they are called in ASP, also any internal permissions are outside my sphere of knowledge.

I have checked file permissions etc. but I have no real way of verifying that within IIS - I am a Linux/Apache/PHP/MySQL man usually, and I hate working with ASP for exactly these reasons.

Can someone run through things to check? Even if basic, it's worth it in case I've overlooked something.

All I did was copy the whole site to my PC, keeping structure etc. intact. I then stuck it in my web root directory so that it would work, and it did - except anything that wants to modify files.

This is kinda important to me to get sorted, as I am working to a tight deadline :(

::] krycek [::

krycek
03-12-2003, 03:45 PM
Oh yeah. Just as extra info:

- Everything is owned by user "Admin"
- "Admin" has permission to do everything to everything

^^^ From Tools -> Security -> User and Group Permissions in Access

Would my Workgroup have anything to do with it...?

The odd thing is, the error message does not look like a security message, but we all know what ASP is like :(

::] krycek [::

Spudhead
03-12-2003, 03:58 PM
I certainly wouldn't recommend this as a fix, but as a quick guide with the permissions thing, this is what I do when I get an error like that:

For every folder from wwwroot down to the one your troublesome database is in, and your database file itself

{

Right click->Properties->General
- Make sure "Read-only" is unchecked.

Properties->Security
- Click "Everyone" and make sure the "Full Control" box is checked.

}


Do it at least twice, and if it still doesn't work, start again. :)

krycek
03-12-2003, 04:09 PM
OK...

I still have no luck :( I am starting to think it is something to do with the directory structure...

Basically, the "wwwroot" is a folder called public_html. However, the database directory is parallel to that, i.e. not under public_html. Hence IIS doesn't really see it etc.

I did a test. I created (using FTP) a new directory on the site, called "test", and copied everything into it. I got the same error when I looked at that test site as I do normally:

Microsoft JET Database Engine error '80004005'

Operation must use an updateable query.

/test/public_html/incRecordEvent.asp, line 26

I'm really stumped on this. I don't know enough about IIS to get it to "see" the database folder (if that is what the problem is) and nothing I try seems to be working :(

::] krycek [::

krycek
03-12-2003, 05:59 PM
OK, I'm pretty sure that this has something to do with the permissions on the directory.

The scripts look for ../database folder.

The scripts are in public_html.

However, public_html has GOT to be the webroot (for some reason!) or else the site will not work.

So, I have tried things like adding the database folder as a virtual directory etc. and nothing works.

Basically, HOW do I get IIS to see a folder above the level of the webroot? (Well, parallel, but I mean, not inside the webroot).

And, HOW can I set permissions on this folder...?

I am running WinXP with IIS5. :)

EDIT: To make it clearer, the scripts can see the database but will only look at it in read-only mode. I need read/write mode and so that's why I am trying to get IIS to see it. :(

::] krycek [::

krycek
03-12-2003, 06:34 PM
Originally posted by Spudhead
I certainly wouldn't recommend this as a fix, but as a quick guide with the permissions thing, this is what I do when I get an error like that:

For every folder from wwwroot down to the one your troublesome database is in, and your database file itself

{

Right click->Properties->General
- Make sure "Read-only" is unchecked.

Properties->Security
- Click "Everyone" and make sure the "Full Control" box is checked.

}


Do it at least twice, and if it still doesn't work, start again. :)

That's been bothering me. My system does not have that setup (WinXP Pro, IIS 5)

In Explorer, Properties does not have a Security tab.

Anyway, I tried all the files permission stuff and nothing changed... grrrr!

::] krycek [::

krycek
03-12-2003, 06:57 PM
OK, this is REALLY weird. But it may be the answer.

In Explorer, the database folder is marked as partly read-only. As in, not a tick, not clear, but partly. If I clear it, or set it and then clear it, or whatever I do, it just comes back again as partly read-only.

How do I clear that value and make it not read-only? :confused: This is baffling me!

::] krycek [::

mivec
12-26-2005, 05:41 AM
i am encountering the same problem with access..."query must be an updateable query"

when i right click my database, i only hv two tabs:

1. General
2. Summary

so no security tab there...how do i get it?

lost....

Morgoth
12-29-2005, 11:51 PM
Try changing the properties of the folder of where the database is located and not the database itself, and you must have administrator access to the files.
Do you understand?

BarrMan
12-30-2005, 04:10 AM
Go to Control Pannel and click on Folder Options, Then click on the tab View and scroll down untill you see Use simple file sharing(recommanded), uncheck that.