posted a week ago no response Please help

T

tw

I'm using code to compact/repair a database

data passed as parameters into the function that does the work strsource and
strdestination as seen from the immediate windowprior to running code
?strsource
C:\disco modifications\Disco 2 Back End.mdb
?strdestination
C:\disco modifications\DiscoCompactRepairTemp


Everything seems to go OK, the function returns true, and no error occurs,
but a log file created has this
message in it
"Modules Container: 'PropDataCopy' stream has a length of zero!"

Can anyone tell me what this means?

Function below

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
 
D

Douglas J. Steele

There's nothing in that code that writes to a log file, nor is there
anything named PropDataCopy in it. Why do you think the log file entry has
anything to do with that function?
 
P

Paul Overway

You'd only get a log file if corruption was found in the database ...so, it
would appear that there is some corruption in the database (see help for
CompactRepair). Assuming you have a module named PropDataCopy, it appears
to have a problem. You might need to import everything to a new
database....except PropDataCopy.
 
T

tw

I do not have a module named PropDataCopy. That's why I posted I don't know
what it is or where it is.
 
T

tw

this is what make me think this code created a log file...

see vbhelp on compactrepair method
"LogFile Optional Boolean. True if a log file is created in the destination
directory to record any corruption detected in the source file. A log file
is only created if corruption is detected in the source file. If LogFile is
False or omitted, no log file is created, even if corruption is detected in
the source file."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top