Update method causes untrappable error. 
Author Message
 Update method causes untrappable error.

I have been working on a database program that uses data bound
controls like the TDBGrid and componants from Crescent.

When I run an update method on a database, I get the error - "Text
property is read only"

None of my controls are locked. I have spent a week on this problem
and had no choice but to ship the product to the customer as is
including the bug because the previous programmer goofed off for
months until the deadline was way past then quit! Now I have to fix
the mess and I can't.

I've used up every hint and inkling of an idea how to figure out what
the problem could be.

My guess is that the update method is updating a control and the
control is not allowing the text to be updated because the database
page is locked. I eliminated all code that assigns anything to a text
property of any control and this did not solve the problem.

When I run the de{*filter*} it shows the line dsLicense.update and when I
step off the update line the change event of the data bound controls
are fired off and I step through the code related to the change event
and when all lines are executed and the End Sub line is reached the
error pops up the instant I step out of the procedure and before I
step into the next procedure.

I'm stumped and have resolved to tell my employer and his client that
I cannot solve this problem and I hate this defeated feeling to hell!
The problem isn't serious. The program IS successfully updating the
database but this damn window keeps popping up and its as annoying as
tap dancing on a hive of killer bees while whistling dixie!

Does anyone have any ideas? Any at all will be gratefully accepted.



Sun, 22 Nov 1998 03:00:00 GMT  
 Update method causes untrappable error.

If you are using an inner join on your data source make sure
the join is to a unique, indexed field else the whole thing becomes read only.

Jim Davidson Cabrea.



Tue, 24 Nov 1998 03:00:00 GMT  
 Update method causes untrappable error.

Quote:

>I have been working on a database program that uses data bound
>controls like the TDBGrid and componants from Crescent.
>When I run an update method on a database, I get the error - "Text
>property is read only"
>None of my controls are locked. I have spent a week on this problem
>and had no choice but to ship the product to the customer as is
>including the bug because the previous programmer goofed off for
>months until the deadline was way past then quit! Now I have to fix
>the mess and I can't.
>I've used up every hint and inkling of an idea how to figure out what
>the problem could be.
>My guess is that the update method is updating a control and the
>control is not allowing the text to be updated because the database
>page is locked. I eliminated all code that assigns anything to a text
>property of any control and this did not solve the problem.
>When I run the de{*filter*} it shows the line dsLicense.update and when I
>step off the update line the change event of the data bound controls
>are fired off and I step through the code related to the change event
>and when all lines are executed and the End Sub line is reached the
>error pops up the instant I step out of the procedure and before I
>step into the next procedure.
>I'm stumped and have resolved to tell my employer and his client that
>I cannot solve this problem and I hate this defeated feeling to hell!
>The problem isn't serious. The program IS successfully updating the
>database but this damn window keeps popping up and its as annoying as
>tap dancing on a hive of killer bees while whistling dixie!
>Does anyone have any ideas? Any at all will be gratefully accepted.

You don't mention what database you are using.
It is possible with Access to set a field attribute that
makes the field read-only.  

If you are using Access, then bring up the database
and go to design mode.  Take a good look at the
values for every field.   Also check the security
settings of the database and the table.

You also need to put:
on local error goto  anError

as the first line in your sub,  write a quick couple of
lines to send the output to a msgbox or debug.  This
will give you more detail.


http://www.*-*-*.com/ ~kd9fb



Thu, 26 Nov 1998 03:00:00 GMT  
 Update method causes untrappable error.

Quote:

> I have been working on a database program that uses data bound
> controls like the TDBGrid and componants from Crescent.
> When I run an update method on a database, I get the error - "Text
> property is read only"

I've run into (and still am stuck on) the same thing.  This is with
VB4.0a-16 and Access 2.0 databases/datacontrols.

Quote:
> None of my controls are locked. I have spent a week on this problem

Yup checked those too..  I also tried opening everything in access
(security that is) to no avail.  The difference I see is that I'm
running into this not with an update but with a .movelast.  Worked
fine till I added this (to get RecordCount).

Quote:
> When I run the de{*filter*} it shows the line dsLicense.update and when I
> step off the update line the change event of the data bound controls
> are fired off and I step through the code related to the change event
> and when all lines are executed and the End Sub line is reached the
> error pops up the instant I step out of the procedure and before I
> step into the next procedure.

Ditto.

Quote:
> I'm stumped and have resolved to tell my employer and his client that
> I cannot solve this problem and I hate this defeated feeling to hell!

Know exactly how you feel!  Why isn't there a way to find out exactly
what "TEXT property is read-only"?

Scott



Fri, 27 Nov 1998 03:00:00 GMT  
 Update method causes untrappable error.

Well I've found out why I was getting this error - "Text property is
read-only" on updating the database. Ultimately its a bug with VB ...
I had a combobox set to style two which is a non-editable drop down
list.

Since the text property of this style of combobox is read-only any
attempt to modify the text property of the control causes the error.

HERES WHERE THE BUG COME IN ....

Attempts to set the data in the database field  associated with the
combobox control can also trigger the error effectively rendering your
program unable to modify the database field without generating an
error! (Using update queries to change the field appear to work
thought but you would have to save the record and update the recordset
first.)

Well when I commented out the code modifying the field in the database
the error STILL popped up!

It appears that the simple act of creating a new record using addnew
is enough to set the stage for this error to pop up after the update
method is finished and all the events triggered by the update event
are finished!!!

The workaround. ....

 Blank out the datasource and datafield properties of the combobox.

Create an edit box with the datasource and datafield properties are
set to the values that WERE in the combobox.

Place the edit box over the text area of the combobox leaving the
down-pointing button of the combobox uncovered.

In the CLICK event of the combobox put something like the following
code ...

textboxName.text = comboboxName.text

In the gotfocus event of the edit box put the following code ...

comboboxName.SetFocus

This will prevent the user from editing the contents of the edit box.

The result will look and act just like the intended combobox should
have MINUS the error message because now the field is associated with
the text of a writeable control - The EDIT box will display the text
found in the database field. The code in the GotFocus event of the
text box prevents the user from editing the text property of the edit
box directly and the visible portion of the combobox (The Arrow)
allows the user to select the item desired and when the item is
selected the click event of the combobox updates the editbox text and
the underlying record is saved when the user clicks on save.

Thats it. I'd rather not have to kludge but thats the way I am using
until a better idea comes along.



Sat, 28 Nov 1998 03:00:00 GMT  
 Update method causes untrappable error.

Quote:


> > I have been working on a database program that uses data bound
> > controls like the TDBGrid and componants from Crescent.

> > When I run an update method on a database, I get the error - "Text
> > property is read only"

> I've run into (and still am stuck on) the same thing.  This is with
> VB4.0a-16 and Access 2.0 databases/datacontrols.

> > None of my controls are locked. I have spent a week on this problem

> Yup checked those too..  I also tried opening everything in access
> (security that is) to no avail.  The difference I see is that I'm
> running into this not with an update but with a .movelast.  Worked
> fine till I added this (to get RecordCount).

> > When I run the de{*filter*} it shows the line dsLicense.update and when I
> > step off the update line the change event of the data bound controls
> > are fired off and I step through the code related to the change event
> > and when all lines are executed and the End Sub line is reached the
> > error pops up the instant I step out of the procedure and before I
> > step into the next procedure.

> Ditto.

> > I'm stumped and have resolved to tell my employer and his client that
> > I cannot solve this problem and I hate this defeated feeling to hell!

> Know exactly how you feel!  Why isn't there a way to find out exactly
> what "TEXT property is read-only"?

> Scott

I had this happen to me too. Although I still haven't found out what the
dreaded 'text' property is about, I did find a 'cure':

It turned out that when you set the recordset property for the data
control in both the control's properties, and, at runtime, in code, this
message eventually pops up. I found, that removing the 'Database' and
'Rowsource' properties from the data control removed the problem.

Hope this helps,

Rob van Wees.



Sat, 28 Nov 1998 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Why Update() method causes current

2. Untrappable error when loading form modally

3. Errors caused by TransferSpreadsheet method

4. PasteSpecial Method of charts causes Run-time error 1004

5. .Move method causes errors in trusted COM addin.

6. .MoveTO method causes errors in trusted COM addin.

7. method save causes unknown run-time error

8. Execute method of Find object causes error 5692

9. text1.setfocus causes error (or any other textbox setfocus method)

10. count method causes win32 error

11. count Method causes win32 error

12. ADO, Dataenvironement, Updating of records causes errors.

 

 
Powered by phpBB® Forum Software