Table is Read Only.

Posted on 2003-03-13
Medium Priority
Last Modified: 2012-05-04
I am working in Delphi 5.  Accessing an Informix DB.  I have all my TQuery's RequestLive properties set to False.  I am using Cached Updates set to True and am using a Update object.  when it hits the end; on the OnUpdateRecord method, I recieve a Table is Read Only. error.  I am inserting into 3 different tables and all of their Read Only properties are set to False.  Any ideas?
Question by:jkrew
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 8132039
do you have open tquery in your ide ,datatbase desktop,quicqreport,rave report or enywhere else?

mostofen problem is when u open in your ide
that meens when you in teh dewelop mode u keep the queries close


Author Comment

ID: 8132114
I activate all 3 tables at the beginning of the OnUpdateRecord method. The Query has been Active since the OnShow method of the form.


Expert Comment

ID: 8137040
Have you tried just using a query to insert instead of the update component?
 FrmDb.QueryInsertMain.SQL.Add('INSERT INTO MAIN');
 FrmDb.QueryInsertMain.SQL.Add('(Prono, Fb_Date, Rec_Date, Batch_Code, Cust_Code, Scac_Code, Enter_Id, Pieces, Weight)');
 FrmDb.QueryInsertMain.SQL.Add('Values(:Prono, :Fb_Date, :Rec_Date, :Batch_Code, :Cust_Code, :Scac_Code, :Enter_Id, :Pieces, :Weight)');
 FrmDb.QueryInsertMain.ParamByName('Prono').AsString := BillNo.Text;
 FrmDb.QueryInsertMain.ParamByName('Fb_Date').AsDate := StrToDate(BillDate.Text);
 FrmDb.QueryInsertMain.ParamByName('Rec_Date').AsDate := Date;
 FrmDb.QueryInsertMain.ParamByName('Batch_Code').AsString := InfoPanel.Panels[0].Text;
 FrmDb.QueryInsertMain.ParamByName('Cust_Code').AsString := InfoPanel.Panels[1].Text;
 FrmDb.QueryInsertMain.ParamByName('Scac_Code').AsString := InfoPanel.Panels[2].Text;
 FrmDb.QueryInsertMain.ParamByName('Enter_Id').AsString := Copy(InfoPanel.Panels[3].Text, 0, 3);
 FrmDb.QueryInsertMain.ParamByName('Pieces').AsInteger:= StrtoInt(Pcs.Text);
 FrmDb.QueryInsertMain.ParamByName('Weight').AsInteger:= StrtoInt(Weight.Text);
I update all my tables in this manner - I'm not sure about Informix though, I'm using Visual Foxpro 5.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 8137885
I found the problem.  I was forgetting to set the UpdateAction := uaApplied.  I really don't understand why this would cause That specific error, however it works.  Thanks for all your time. =))

Expert Comment

ID: 8140818
Hello jkrew,

Would you please tell me you set UpdataAction property of which component?

Author Comment

ID: 8143784
It would be of the TQuery Object, in the UpdateRecord event. It is covered in the Delphi's developer's guide pg.20-37 (Delphi 6).  After you do your actions (ukInsert;ukModify;ukDelete), you must set the UpdateAction otherwise it will abort the operation and raise an exception.  I just was not expecting "Table is Read Only".

Expert Comment

ID: 9316790
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.

Accepted Solution

ee_ai_construct earned 0 total points
ID: 10606639
PAQed, with points refunded (75)

Community Support Moderator

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month9 days, 1 hour left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question