Board index » jbuilder » How to update a record

How to update a record


2005-01-09 11:54:40 PM
jbuilder2
Hi,
I want to modify a specific record of my table with JBuilder X foundation, but I have an error : the data model isn't opened.
For example I call the following method in order to modify the line 6 and column 9 of my table :
public void setValueAt(Object[] value, int row, int column)
{
pieces.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(database1, "SELECT * FROM MYTABLE", null, true, Load.ALL));
pieces.goToRow(row);
String tmp = value[4].toString();
if((tmp.compareTo("")) != 0)
pieces.setString(column, tmp);
}
I'm wrong but I can't see where.
Thanks for any advice.
 
 

Re:How to update a record

In <41e153c0$ XXXX@XXXXX.COM >Gandalf wrote:
Quote

Hi,

I want to modify a specific record of my table with JBuilder X
foundation, but I have an error : the data model isn't opened.

For example I call the following method in order to modify the line 6
and column 9 of my table :

public void setValueAt(Object[] value, int row, int column)
{
pieces.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(
database1, "SELECT * FROM MYTABLE", null, true, Load.ALL));
pieces.goToRow(row); String tmp = value[4].toString(); if((tmp.
compareTo("")) != 0) pieces.setString(column, tmp);
} }

Well, you never did the execute or the open.. To quote the help..
"When you are not using a visual component, you must explicity open a
DataSet"
This was in the help under "Retrieving data from a data source"
John..
--
=============================================
TeamB are volunteer helpers. Please DO NOT REPLY VIA EMAIL!
Post all questions and replies to this newsgroup ONLY
For papers on DataExpress, Applets, JSP, and Web Development go to:
www.microps.com/mps/paperFAQ.html
====================================================