?
Solved

Table is Read Only.

Posted on 2003-03-13
9
Medium Priority
?
732 Views
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?
0
Comment
Question by:jkrew
[X]
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
9 Comments
 
LVL 3

Expert Comment

by:ILE
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

:))
0
 

Author Comment

by:jkrew
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.

0
 

Expert Comment

by:OneSurfer
ID: 8137040
Have you tried just using a query to insert instead of the update component?
like:
{********************************************************}
FrmDb.QueryInsertMain.SQL.Clear;
 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);
 FrmDb.QueryInsertMain.ExecSQL;
{********************************************************}
I update all my tables in this manner - I'm not sure about Informix though, I'm using Visual Foxpro 5.
0
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

by:jkrew
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. =))
0
 
LVL 1

Expert Comment

by:merry_prince
ID: 8140818
Hello jkrew,

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

Author Comment

by:jkrew
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".
0
 

Expert Comment

by:CleanupPing
ID: 9316790
jkrew:
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 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 

Accepted Solution

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

ee_ai_construct
Community Support Moderator
0

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