[ IDE @ 21.10.2006. 20:50 ] @
Imam jedno pitanje

Zasto kad napunim access bazu npr. na 100 MB i onda uradim
delete * from IME_TABELE_KOJA_JU_JE_NAPUNILA_TOLIKO i kada ovaj SQL upit pobrise sve iz ove tabele , baza i dalje ima velicinu 100MB??

Logicki ona bi trebalo da se smanji na nekih npr. 1MB koliko zauzimaju ostale tabele...

Dobro, kada odem kasnije na "compact and repair" (ako se sjecam, ovako se nesto zove) onda se ona stvarno smanji...

Ima li neki nacin da preko SQL upita uradim njeno smanjivanje na onu velicinu kolika bi trebala stvarno biti nakon sto obrisem ogromne tabele...??
[ mika @ 23.10.2006. 09:06 ] @
Ne može preko SQL upita da se uradi repair, ali može preko VBA koda. Evo ti primer iz helpa:

The following example compacts and repairs a database, creates a log if there's any corruption in the source file, and returns a Boolean value based on whether the recovery was successful. For the example to work, you must pass it the paths and file names of the source and destination files.
Code:



Function RepairDatabase(strSource As String, _
        strDestination As String) As Boolean
        ' Input values: the paths and file names of
        ' the source and destination files.

    ' Trap for errors.
    On Error GoTo error_handler

    ' Compact and repair the database. Use the return value of
    ' the CompactRepair method to determine if the file was
    ' successfully compacted.
    RepairDatabase = _
        Application.CompactRepair( _
        LogFile:=True, _
        SourceFile:=strSource, _
        DestinationFile:=strDestination)

    ' Reset the error trap and exit the function.
    On Error GoTo 0
    Exit Function

' Return False if an error occurs.
error_handler:
    RepairDatabase = False

End Function