473,394 Members | 1,932 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Compile Error: Can't Assign To Read-Only Property

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.

Nov 13 '05 #1
2 10090
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Not a direct answer, but, perhaps if you put the CreateProperty()
parameters in the parentheses it would work more consistently.

db.Properties.Append db.CreateProperty("AppIcon", dbText, strAppPath)

IOW, you wouldn't be assigning a value to the .Name parameter in a
different VBA command.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQd1x0oechKqOuFEgEQIvcwCfSHSPEQLTaksSkdBpvBscYL aAUu8AoON2
wUAaNkHnIf6Uu9Logrp+Re07
=SDqE
-----END PGP SIGNATURE-----
Wayne wrote:
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.

Nov 13 '05 #2
Thanks for the reply. I've changed the code as you have suggested.
No, I'm not assigning the .Name parameter anywhere else. I've used
this code which I found here on the group many times before to set the
application icon without this problem ever arising. I can't help but
be suspicious that it has something to do with the fact that the
database was created in version 2003 file format and then converted
back to version 2000 file format. In both databases that have given me
a problem, the problem seemed to arise after the conversion. I'm not
sure what the ramifications of the backward conversion are but all the
other databases in which I have used this code that have never given a
problem were created in 2000 file format using Access 2003.

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Lionel B | last post by:
Running VC++ 6 under Win2K on i386. I would like to assign a (compile-time) constant that resolves to a quiet NaN (of type double) I can assign a quiet NaN to a *variable* (of type const...
4
by: learning_C++ | last post by:
Hi, I try to use input = new istrstream(argv,strlen(argv)); in my code, but it always says error: " error: parse error before `(' token" please help me! Thanks, #include <map>
9
by: M.N.A.Smadi | last post by:
HI; I am having the following error. I am using someone else's code and all they are doing is pass an argv to a function then def execute_action(manager, argv): method_name =...
5
by: Brice Prunier | last post by:
Here under 4 schemas i'm working with ( it may be long: sorry...) The context is the following : Resident.xsd imports Person.xsd and includes Common.xsd ( anonimous schema: no TargetNamespace )...
9
by: serge | last post by:
I have a stored procedure that is over 1000 + lines of code. When i try to compile I get the following error: ABC.TEST123: 1285: SQL0104N An unexpected token "END" was found following " END...
7
by: jlara | last post by:
Having been stung by the same problem twice, I would like to automatically check if the bitfields are regarded properly by the compiler. For example, if I define the following structure: ...
26
by: steve | last post by:
Well I've been working all morning and have finally found the source of my "bus error (signal 10)" errors. The source is odd. The error occurs in any function where I make the function call: ...
1
by: electrixnow | last post by:
Help!, I need to compile this code with static libs so it run on another XP machine that does'nt have MS Studio installed. When I compile now I get an ERROR: 1>------ Rebuild All started:...
8
by: farseer | last post by:
Can someone please assist me in understanding why i am receiving this error: " error C2440: 'type cast' : cannot convert from 'LRESULT (__cdecl CMyToday::* )(HWND,UINT,WPARAM,LPARAM)' to 'LONG' "...
5
by: wong_powah | last post by:
#include <vector> #include <iostream> using std::cout; using std::vector; enum {DATASIZE = 20}; typedef unsigned char data_t;
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.