Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 744
  • Last Modified:

Table is Read Only.

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
jkrew
Asked:
jkrew
1 Solution
 
ILECommented:
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
 
jkrewAuthor Commented:
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
 
OneSurferCommented:
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
jkrewAuthor Commented:
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
 
merry_princeCommented:
Hello jkrew,

Would you please tell me you set UpdataAction property of which component?
0
 
jkrewAuthor Commented:
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
 
CleanupPingCommented:
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
 
ee_ai_constructCommented:
PAQed, with points refunded (75)

ee_ai_construct
Community Support Moderator
0

Featured Post

Industry Leaders: 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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now