The following which is driving me nuts has occurred in 2 of my
databases. Both databases were written in Access 2003 and then
converted back to Access 2000 format. I've done this so I can create an
Access 2K mde for compatibility reasons.
Everything worked fine: the database could be compiled and converted to
an .mde several times. Then for no apparent reason when I tried to
compile again I got the following error: "Compile Error: Can't assign
to read only property" for the ".name" property in the following code.
Dim strAppPath As String
Dim prpAppIcon As Property
Dim db As Database
On Error Resume Next
strAppPath = mydbPath() & "Fire.ico" 'set icon path
Set db = CurrentDb
Set prpAppIcon = db.CreateProperty()
prpAppIcon.Name = "AppIcon"
prpAppIcon.Type = dbText
prpAppIcon.Value = strAppPath
db.Properties.Append prpAppIcon
db.Properties("AppIcon") = strAppPath
Application.RefreshTitleBar
Set db = Nothing
Exit Function
End Function
Why will it compile a dozen times and the next time give the error? I'm
assuming from the error message that the property was not read only and
then something made it read only.
Any help would be appreciated.