Jump to content

 
Photo

Deleting or Adding Field in ArcGIS

- - - - -

  • Please log in to reply
13 replies to this topic

#1
François Goulet

François Goulet

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 688 posts
  • Gender:Male
  • Location:Mille-Isles, Qc
  • Interests:Cartography, History, Graphic Design and almost everything else...
  • Canada

Once in a while (and it's more 3 out of 4 attempts right now... aaargggjjj!), I try to delete a field or adding one, I got the message "Cannot get exclusive schema lock. Either being edited or in use by another application" when I use ArcToolbox or "Can not delete the select field from the selected table/feature class because it is use by another application/user" and I know for sure that it is not! I create those shapefiles and I'm the only one using them.

I re-started my computer and re-try to delete my field (first thing I do after the restart) and still get the same message.

I try the Unlocker which is suppose to remove any lock (you kinda figure it out by the name ;) ) and it didn't find any...

Why can't I modify my shapefile and how can I correct the situation?

Thanks!

#2
jrat

jrat

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 143 posts
  • Gender:Male
  • Location:Hagerstown, MD
  • United States

I hate this message too. Many times I wanted to pull my hair out. Most time I am the one creating the schema lock. I am sure you tried this but my issue was having ArcCatalog and ArcMap open at the same time. Have you tried moving your shapefile to a file geodatabase? I had some issues with Personal Geodatabases and schema locks.

#3
James Hines

James Hines

    James Anthony Hines

  • Validated Member
  • PipPipPipPipPipPip
  • 537 posts
  • Gender:Male
  • Location:Centreville, Nova Scotia
  • Interests:Cartography, Philosophy, Politics, Psychology, Economics, Occultism, Spiritualism
  • Canada

Here I found a discussion on your problem: http://forums.esri.c...p...88&t=254537

"There is much beauty that we fail to see through our own eyes teeming with life forms that give us that perception of our reality.  Leaves on the trees blowing gently in the wind, or scarily, the waves pounding through high surf, or lightly on a warm summer’s day; that opportunity to sit or swim in the water on a white beach.   That comfort to shout, “The universal conscious do you hear me?  I am alive, guide me dear logos towards the path of rightnesses.”  Earned what has been kept, no longer to be absorbed into a life filled with cold damn winds and  that stubborn fog clouding  my vision with nothing but darkness."


#4
François Goulet

François Goulet

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 688 posts
  • Gender:Male
  • Location:Mille-Isles, Qc
  • Interests:Cartography, History, Graphic Design and almost everything else...
  • Canada

I could move the files, but since I absolutely need them to be in .shp, I'll have to re-export everything. I'll try and if it's a workaround I'll do it, but it's still a pain in the *ss...

Thanks for the link Hasdrubal.

The final post ended like this: Does this mean that there is a 128 character limit to the path for a shapefile?
Well, I tried and it seems to be right.

I already had 120 characters in my path's name (it's very standardized...) so I created a shp with a short name (abc.shp) for a total of 127 characters. Tried adding fields and it worked. I created another one with a lot more characters (abcdefghijklmnopqrstuvwxyz.shp) so... well a lot more than 128. Adding and deleting fields worked.

When I created another with a short name (a.shp), it didn't cause any problem but when I created a new one with a long name (abcdefghijklm.shp), I couldn't add any fields or deleting any in my first one with the long name.

So, it appears that Arc is reading the first 128 characters and if after that, there's more that one file with the same first 128 characters, it can't modify it because it can't find the right one...

It's kind of like in the old times, when Dos had 8 char file names... myshap~1.shp ...

But, (because there's always a but), that problem's not happening on one of my colleague's computer.

I don't understand why such problem should occurs in a software worthing more than my annual salary...

:(

#5
François Goulet

François Goulet

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 688 posts
  • Gender:Male
  • Location:Mille-Isles, Qc
  • Interests:Cartography, History, Graphic Design and almost everything else...
  • Canada

I tried on another computer and didn't worked too... The only one that could do it had ArcInfo... the others have ArcView... Could it only be a licence level limitation?

#6
David T

David T

    GIS Manager, USMC, MCIWEST-MCB Camp Pendleton

  • Validated Member
  • PipPipPipPip
  • 192 posts
  • Gender:Male
  • Location:San Diego, California
  • United States

Usually, in cases like this, there are a couple of things that can be the cause of the problem:

- Viewing the file in both ArcCatalog and ArcMap at the same time (causes a schema lock - you'll have to exit out of one of those programs).
- A schema lock that did not properly 'unlock' when you last exited the program.

The second item usually happens to a personal geodatabase. Exit out of both programs, and in Windows Explorer, look in the folder that the file sits in. If you see a .ldb file, then there is a lock file on the geodatabase. Delete that file, and your geodatabase will be unlocked again.
David Toney, GISP
GIS Manager
United States Marine Corps
West Coast Installations

#7
François Goulet

François Goulet

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 688 posts
  • Gender:Male
  • Location:Mille-Isles, Qc
  • Interests:Cartography, History, Graphic Design and almost everything else...
  • Canada

Here's the answer from the Mapping Center:

Locking on shapefiles is determined by the operating system. There are no lock files like there might be with a personal geodatabase.

So, if you cannot modify the file, one of two things is likely the culprit:

1. There actually is a process using the data. This could be you with a file browser, ArcGIS server, serving the data, or if the folder that contains the shapefile is shared, somebody else.
2. The permissions of the file or folder are causing a the problem. Check the Security tab of both the folder and file properties (right click on each in the Windows file browser). The general tab of the file properties will tell you whether the file is Read-only, which can also be a problem (I'm looking at Window XP Professional, so you OS may be different).


I was absolutely 100% sure that no other process was using the data. I only had ArcMap or ArcCatalog or Windows Explorer one at a time. I also chech before that they were no Read Only files.

I finally drag the entire folder on my desktop (we're not supposed to do that) and I didn't had a single problem for the rest of the afternoon. I'm more and more convinced that it has something to do with the path length.

Thanks guys!

#8
frax

frax

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 2,304 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Interests:music, hiking, friends, nature, photography, traveling. and maps!
  • Sweden

There are some good sysinternals apps that can help you pinpoint what is locking a file (or if it is some cause - check out handle.exe for instance: http://technet.micro...s/bb896655.aspx

I often do a handle | less to find out more about things like that.
Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter

#9
François Goulet

François Goulet

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 688 posts
  • Gender:Male
  • Location:Mille-Isles, Qc
  • Interests:Cartography, History, Graphic Design and almost everything else...
  • Canada

There are some good sysinternals apps that can help you pinpoint what is locking a file (or if it is some cause - check out handle.exe for instance: http://technet.micro...s/bb896655.aspx

I often do a handle | less to find out more about things like that.


Thanks Hugo! :)

#10
François Goulet

François Goulet

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 688 posts
  • Gender:Male
  • Location:Mille-Isles, Qc
  • Interests:Cartography, History, Graphic Design and almost everything else...
  • Canada

Well, I retried the tests I did Friday (with the same results) and check for handles with Hugo's suggestion and I didn't find any. I could even delete a file with Windows Explorer or rename it while it was open in ArcMap so I tend to believe ESRI's specialist saying that there's no locking of shapefile in Arc...

:(

#11
MostlyHarmless

MostlyHarmless

    Key Contributor

  • Validated Member
  • PipPipPip
  • 52 posts
  • Gender:Male
  • Location:Chicago
  • United States

When ArcGIS fails me, I just open in excel and manually delete what I need and re-save as dbf (can't save as dbf in MSO 2007 though!)

#12
François Goulet

François Goulet

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 688 posts
  • Gender:Male
  • Location:Mille-Isles, Qc
  • Interests:Cartography, History, Graphic Design and almost everything else...
  • Canada

(can't save as dbf in MSO 2007 though!)


Guess what I have installed? ;)

Right now, I just export my shp on my desktop, do what I have to do and then overwrite my original shapefile with that one...

#13
MostlyHarmless

MostlyHarmless

    Key Contributor

  • Validated Member
  • PipPipPip
  • 52 posts
  • Gender:Male
  • Location:Chicago
  • United States

^^ And it works for you? If I have to do anything related to dbfs, I used to use MSO 2003, but now I just use Open Office which handles dbfs quite well. I haven't had much success with MSO 2007 and dbfs...but I haven't tried very hard.

#14
François Goulet

François Goulet

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 688 posts
  • Gender:Male
  • Location:Mille-Isles, Qc
  • Interests:Cartography, History, Graphic Design and almost everything else...
  • Canada

Sorry if I mislead you... 90% of the time, when I can't modify my tables in Arc, it seems to be a problem with the path length... So, just working in my C:/Temp or my desktop allows me to modify them within ArcGIS...




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

-->