(Updated: 2006.04.07 10:12:42 AM)
| |
Thank you all for you comments on what happens when I report a c00000005 error to Microsoft.
However I must find some way around the problem, I cannot just wait for a benevolent Microsoft.
Here is the situation:
I have a
Visual FoxPro (version 7 Service pack 1) database of tables.
I am aware that no file can exceed 2Gb so I have organised the data into seperate tables where non is likely to exceed 2Gb in either the DBF or the FPT.
The largest table is now 1,003,998,464 bytes (it is an FPT )
total of all tables in database 5.92 Gb
However the database has now grown to nearly 75% of its original size.
Whenever I run the .EXE to add more records I get a c0000005 error.
(but the line of code indicated is not consistent)
I have also tried running from the
FoxPro development environment.
Same error - different line of code indicated.
This is on WIndows NT 4.0 (service pack 6a)
I have tried copying all the data to a win98 machine
and also a Win XP machine.
Same result (c0000005 error) on all the above OS but the line of code notified changes. (it has even been reported on the "close databases all" command in the closedown function)
The code does not fall over when I run against a much smaller test database (on the same machine under the same administrator logon)
Does anyone have any suggestions (other than to re-write with Visual Basic using
My SQL)
That your code does not fail when run against another set of data indicates there is probably a corruption problem within your data. An index is the most likely cause, a corrupted table next likely.
There are tools such as
Stonefield Database Toolkit and
ReCover (
www.abri.com) that will let you test and repair your tables. They are an inexpensive investment.
You can do this yourself in a number of ways. Bear in mind that dropping index tags removes the relations defined on them and drops the associated Relational Integrity code, if any. You can use the
GenDBC tool provided with VFP to generate a script of your database's structure, and use that to create an exact duplicate of your database, and then copy records from one set of tables to the other. Or, if you are not using relations or RI code, or are willing to recreate them, you can DELETE TAG ALL and INDEX for each table (it's better to delete and recreate than reindex, as corruption in the header *might* not be delected or fixed.) --
Ted Roche
Sometimes if you modify the table and add a field >Save the table> Open it up again and then remove it the problem will go away. Good luck. I am having the problem myself. --
Kip Dole
Here is code to possibly fix your dbf's
*// WKD date modified 10:44:40 03/31/2004
*// xFixTable.prg
*// This program attempts to fix tables
*// by adding a field then removing the field
CLOSE ALL
nReturnValue=adir(aMyArrayTables,[*.dbf])
ON ERROR do nothing
nTotalArray = ALEN(aMyArrayTables,1)
FOR nCount = 1 TO nTotalArray
sTable = JUSTSTEM(aMyArrayTables[nCount,1])
IF INLIST(substr(sTable,1,1),[$],[!]) OR VAL(sTable) > 0 OR [.] $ sTable
LOOP
ENDIF
USE IN SELECT('&sTable.')
WAIT WINDOW [Currently fixing ] + sTable NOWAIT
USE &sTable. IN 0 ALIAS &sTable. EXCLUSIVE
ALTER TABLE &sTable. ADD COLUMN xAddToFix c(1)
ALTER TABLE &sTable. DROP COLUMN xAddToFix
USE IN SELECT('&sTable.')
ENDFOR
ON ERROR
**********************
Function l_message
**********************
LPARAMETERS sFile
messagebox([There was a problem opening ] + sFile,0,[Dbf Problem])

I have seen memo files that have been corrupted in such a way that they occasionally cause c0000005 errors. My solution has been to run the following code for each table in the database:
USE (lcTable) ALIAS oldTable EXCLUSIVE
COPY STRUCTURE TO newTable DATABASE myDatabase NAME newTable
USE newTable IN 0 EXCLUSIVE
SELECT newTable
FOR I = 1 TO Fcount()
lcField = Field(I)
REPLACE newTable.&lcField WITH oldTable.&lcField
ENDFOR
ZAP IN oldTable
SELECT oldTable
APPEND FROM newTable
REMOVE TABLE newTable DELETE
USE IN oldTable
Of course, this code may need a little bit of tweaking before you can use it, depending on your situation - you may need to remove and restore any triggers, etc.
--
Peter Crabtree
It needs a touch more than a 'little' tweaking. It's missing the main loop through the records of oldTable, and an append into newTable. Here's what I used:
PROCEDURE fixtable
LPARAMETERS tcTable
SET MESSAGE TO 'Fixing table ' + tcTable
USE (tcTable) ALIAS oldTable EXCLUSIVE
IF INDBC('newtable', 'TABLE')
DROP TABLE newtable
ENDIF
COPY STRUCTURE TO newTable DATABASE YRA NAME newTable
USE newTable IN 0 EXCLUSIVE
SELECT oldtable
SCAN FOR NOT EOF()
SELECT newTable
APPEND blank
FOR I = 1 TO Fcount()
lcField = Field(I)
REPLACE newTable.&lcField WITH oldTable.&lcField
ENDFOR
SELECT oldtable
ENDSCAN
SET SAFETY OFF
ZAP IN oldTable
SET SAFETY ON
SELECT oldTable
APPEND FROM newTable
REMOVE TABLE newTable DELETE
USE IN oldTable
SET MESSAGE to
-- June Kendrick
4/4/2006:
Please help. Just today I get the 0xc0000005 error doing something extremely simple in VFP8. I'm working solely in the development env. I have 2 tables, t1 and t2, both have a common field objid. If I run SELECT * FROM T1 WHERE OBJID IN (SELE OBJID FROM T2) I get this error and VFP crashes.
T1 is a free table with about 190 fields and 8000 records. T2 is a table with 120 fields and 12000 records, belongs to a database. I deleted the index file for T2 and recreated all the indexes. One field in T2 is a memo field and I ran June Kendrick's procedure above on it, did not help. Even if I
SELECT * FROM T1 INTO TABLE T11
SELECT * FROM T2 INTO TABLE T12
SELECT * FROM T11 WHERE OBJID IN (SELE OBJID FROM T12)
It still crashes! However if I do the select into *another* table e.g.
SELECT * FROM T1 WHERE OBJID IN (SELE OBJID FROM T2) INTO TABLE T3 , or
SELECT * FROM T11 WHERE OBJID IN (SELE OBJID FROM T12) INTO TABLE T3
it seems to work!
I do not know what to do next. I have been doing the same kind of select constantly for the last 2 years with VFP8 and this has never happened before!
I apologize if it's a breach of protocol to post here. I do not understand what wiki is.
XL97: Page Fault or Violation When You Click Options on the Tools Menu
Excel.exe Exception: access violation (0xc0000005), Address 0x006f0066.
http://support.microsoft.com/?kbid=108032 (10/26/2000)

Try putting the statement =SYS(1104) before you update the data
-
Todd Haehn
OFF97: Problems with Millennium and Mystique Video Cards
MSOFFICE.exe Access violation (0xc0000005), address 0x77f941eb
http://support.microsoft.com/?kbid=166125 (5/23/2003)
ACC: Replication Fails with More Than 128 Shares on Computer
MSACCESS.exe Exception: access violation (0xc0000005), Address: 0x77f7d357
http://support.microsoft.com/?kbid=173005 (5/9/2003)
Illegal Operations or Access Violations When Starting Windows
Explorer access violation (0xC0000005) at address
http://support.microsoft.com/?kbid=175930 (i. e. 4, 5. W95/98/se/NT 12/6/2003)
Error Renaming Files or Folders with Thumbnail View Enabled
Explorer.exe Exception: access violation (Oxc0000005), Address: 0x01b33404
http://support.microsoft.com/?kbid=177323 (i. e. 4. W95/NT4 11/5/2003)
Clicking OK in About Internet Explorer Causes Error Message
EXPLORER.EXE Exception: access violation (0xc0000005),
http://support.microsoft.com/?kbid=178689 (i. e. 4, 5. W95/98/NT4 12/16/2003)
PRJ98: Error Message If Calendar Name Longer Than 51 Characters
Winproj.exe Exception access violation (0xc0000005), address: 0x3002ec85
http://support.microsoft.com/?kbid=179779 (10/17/2002)
"Illegal Operation" or "Application Error" Opening a Web Page
Iexplore.exe Exception: access violation (0xc0000005), Address: 0x70422e5d.
http://support.microsoft.com/?kbid=185512 (i. e. 4. W95/NT4 5/12/2003)
OL97: Lotus cc:Mail 7.x, 8.x Hangs If Outlook 97 SR-2 Installed
A fatal error has occurred. The program will be shut down C0000005 - BFF7B983
http://support.microsoft.com/?kbid=194455 (10/26/2000)
IExplore Caused an Invalid Page Fault in Module
IExplore.exe Exception: access violation (0xc0000005), Address: 0x00000000
http://support.microsoft.com/?kbid=218983 (i. e. 5. W95/98 11/14/2003)
OFF2000: Setup Error 2755 with Previous Office Version Installed
Exception code: C0000005 ACCESS_VIOLATION. Module: C:\WINNT\System32\ntdll.dll Function: 0x77f7bdd3
http://support.microsoft.com/?kbid=220780 (9/28/2002)
IEXPLORE.exe Exception: Access Violation (0xc0000005), Address 0x702be865
When Installing Multiple Packages from More Than One CAB File with an OSD File
http://support.microsoft.com/?kbid=240023 (i. e. 5. W98/NT4 10/1/2002)
OFF2000: Problems with Millennium and Mystique Video Cards
MSOFFICE.EXE Access violation (0xc0000005), address 0x77f941eb.
Under Microsoft Windows NT, when you change the color of the Office toolbar on the Office Shortcut Bar.
http://support.microsoft.com/?kbid=240419 (5/23/2003)
Access Violation in MSHTML Error Message in Internet Explorer 5
The instruction at "0x70c56780" referenced memory at "0x00000000. The memory could not be "read".
When you view the Dr. Watson log after this error occurs, the logged access violation may be similar to:
Application exception occurred: App: exe\explorer.dbg (pid=134). Exception number:c0000005 (access violation).
http://support.microsoft