473,625 Members | 2,687 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.CreateProper ty()
prpAppIcon.Name = "AppIcon"
prpAppIcon.Type = dbText
prpAppIcon.Valu e = strAppPath
db.Properties.A ppend prpAppIcon
db.Properties(" AppIcon") = strAppPath
Application.Ref reshTitleBar

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 10107
-----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.A ppend db.CreateProper ty("AppIcon", dbText, strAppPath)

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

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

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

iQA/AwUBQd1x0oechKq OuFEgEQIvcwCfSH SPEQLTaksSkdBpv BscYLaAUu8AoON2
wUAaNkHnIf6Uu9L ogrp+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.CreateProper ty()
prpAppIcon.Name = "AppIcon"
prpAppIcon.Type = dbText
prpAppIcon.Valu e = strAppPath
db.Properties.A ppend prpAppIcon
db.Properties(" AppIcon") = strAppPath
Application.Ref reshTitleBar

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
6933
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 double, say) by eg.: const double qnan = fmod(1.0,0.0);
4
6008
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
5553
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 = argv.pop(0).lower() and am getting this strange error.
5
3806
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 ) Person.xsd includes Common-Naming.xsd ( anonimous schemas ) Common-Naming.xsd includes common.xsd ( both are anonimous schemas ) Compilation of Resident.xsd raise the following exception: "System.Xml.Schema.XmlSchemaException: The attribute 'oid'...
9
3757
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 IF; END IF; ". Expected tokens may include: "END". LINE NUMBER=1285. SQLSTATE=42601 I tried creating a new tablespace + buffer pool on this database but still
7
2091
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: typedef struct { unsigned int : 4; unsigned int tffca : 1; unsigned int tsfrz : 1; unsigned int tswai : 1;
26
4799
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: (void)sprintf(ptr_testing, "This is my string"); This in itself isn't where the actual error occurs. The error occurs at any later point, in the same function where the sprintf() call is made, where I try to assign a value to one of the...
1
5382
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: Project: drawing_control, Configuration: Release Win32 ------ 1>Deleting intermediate and output files for project 'drawing_control', configuration 'Release|Win32'
8
2714
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' " Here is the source snippet that is causing this compile error. The error is caused by the SetWindowLong line below. MyDataWin.h WNDPROC _hOldWndProc;
5
5034
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
8182
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8635
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8352
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8494
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7178
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6115
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1800
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.