CDaoWorkspace::RepairDatabase crash 
Author Message
 CDaoWorkspace::RepairDatabase crash

When I call CDaoWorkspace::RepairDatabase() with a *valid* file name which
is *not* locked, I get an access violation error. How can I get it to work?


Mon, 07 May 2001 03:00:00 GMT  
 CDaoWorkspace::RepairDatabase crash
Hi Francois,

Is the database open?  RepairDatabase and CompactDatabase must only be used
on closed databases.

HTH
--
=================
Frank Hickman
NobleSoft, Inc.


=================



Tue, 08 May 2001 03:00:00 GMT  
 CDaoWorkspace::RepairDatabase crash
No, its not open...
Quote:
>Is the database open?  RepairDatabase and CompactDatabase must only be used
>on closed databases.



Tue, 08 May 2001 03:00:00 GMT  
 CDaoWorkspace::RepairDatabase crash
Hi Francois,

Is your error an application error, system error or DAO error?

--
=================
Frank Hickman
NobleSoft, Inc.


=================



Fri, 11 May 2001 03:00:00 GMT  
 CDaoWorkspace::RepairDatabase crash

Quote:
>Hi Francois,

>Is your error an application error, system error or DAO error?

Its a plain Access Violation (not Access as the app..), that is, a CPU
generated 0xC0000005 exception.


Sat, 12 May 2001 03:00:00 GMT  
 CDaoWorkspace::RepairDatabase crash
Hi Francois,

Can you post the code block that's causing this exception?  This particular
exception is usually caused by using an uninitialized pointer or a pointer that
is not pointing to a valid process memory location.

--
=================
Frank Hickman
NobleSoft, Inc.


=================



Sun, 13 May 2001 03:00:00 GMT  
 CDaoWorkspace::RepairDatabase crash
Yeah I know about exceptions, but here's the code section:

    // csAccessDB is an STL string type.

    if( !csAccessDB.empty() ){

        char szTemp[ 512 ];
        char szTempFile[ 512 ];

        GetTempPath( 512, szTemp );
        GetTempFileName( szTemp, "T4C", 0, szTempFile );

        TRACE( "\r\nAccessDB=%s.", csAccessDB.c_str() );

        // Create a temporary file.
        HANDLE hFile;
        hFile = CreateFile(
            csAccessDB.c_str(),
            GENERIC_READ | GENERIC_WRITE,
            FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
            NULL,
            0,
            0,
            NULL
        );
        if( hFile != NULL ){
            // Close the file (so its unlocked).
            CloseHandle( hFile );
            CDaoWorkspace::RepairDatabase( csAccessDB.c_str() );// crash,
either of them crash
            CDaoWorkspace::CompactDatabase( csAccessDB.c_str(), szTempFile,
dbLangGeneral, 0, csAccessPwd.c_str() );// crash

            DeleteFile( csAccessDB.c_str() );
            MoveFile( szTempFile, csAccessDB.c_str() );
        }
    }

// thanks ;-)
/*

Quote:
>Can you post the code block that's causing this exception?  This particular
>exception is usually caused by using an uninitialized pointer or a pointer
that
>is not pointing to a valid process memory location.

*/


Sun, 13 May 2001 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Using CDaoWorkspace::RepairDatabase

2. What does CDaoWorkspace::RepairDatabase really do?

3. CDaoWorkspace::RepairDatabase

4. Testing RepairDatabase

5. ADO RepairDatabase?

6. cdaoworkspace

7. Problem creating a new CDaoWorkspace with user other than Admin

8. CDaoWorkspace.CompactDatabase

9. CDaoWorkspace and Transactions - Problem

10. CDaoWorkspace* as member variable property type.

11. CDaoWorkspace problem?

12. CDaoWorkspace and Jet 4.0

 

 
Powered by phpBB® Forum Software