New Record in Database problems

Hi All:
I am new to Appleworks, I have been building a Database and everything was working fine, but suddenly everytime I try to enter a New Record instead of giving me Blank Field it repeats a record I have entered before, and I can't seem to get a clean new record. I am sure I am not duplicating it. I am typing Command R
Thanks a lot
Alex Neuman

Hi,
As much as I use and appreciate Apple hardware and software products, I must say that the Database section of AppleWorks is flaky and needs work. I suspect this will never happen given that iWorks is now Apple's front-runner. As far as I know iWorks doesn't have a db module anyway. I use Appleworks (db) in my work as music contractor as well as for invoicing and other routine applications. Until recently everything was fine. Then I built a db that had a whole lot more fields and formulae and was designed to account for just about any variable that might crop up when paying an orchestra. It was very frustrating. The problem arose when trying to delete fields. I finally came up with a workable db but it's bloated since it contains many unused fields that have been converted to "text" fields. They simply can't be deleted or AW crashes.
It's important to me to have a different db for each job I'm handling due to confidentiality, so it's imperative that I be able to open an existing db, delete all records, save under a new name, and then proceed to customize the new db to suit the needs of the new job. Appleworks hasn't been up to the task. I've mentioned this before on this forum.
Enter Filemaker Pro. There's a demo available. It's a much more fully implemented db front end: multiple tables per file, easy (and very familiar to AW users) to use interface, and perhaps best of all, great options for importing and exporting data.
That's where I'm spending my next few bucks.
RW

Similar Messages

  • Entity Framework doesn't save new record into database

    Hy,
    I have problem with saving new record into database using Entity Framework.
    When I run program, everything seems normal, without errors . Program shows existing, manually added records into the database, and new one too. But new one isn't save into database after running program.
    I've got no idea where's problem. There is code for add new record, show existing.
    Thanks for help!!
    // add new record
    using (var db=new DatabaseEntitiesContext())
    var person = new Table()
    First_Name = "New_FName",
    Second_Name = "New_SName",
    PIN = "4569"
    db.Tables.Add(person);
    db.SaveChanges();
    //show all records
    using (var db=new DatabaseEntitiesContext())
    var selected = from x in db.Tables
    select x;
    foreach (var table in selected)
    Console.WriteLine("{0}{1}{2}",table.First_Name,table.Second_Name,table.PIN);

    Hi BownieCross;
    If you are using a local database file in your project the following may be the cause.
    From Microsoft Documentation:
    Issue:
    "Every time I test my application and modify data, my changes are gone the next time I run my application."
    Explanation:
    The value of the Copy
    to Output Directory property is Copy
    if newer or Copy
    always. The database in your output folder (the database that’s being modified when you test your application) is overwritten every
    time that you build your project. For more information, see How
    to: Manage Local Data Files in Your Project.
    Fernando (MCSD)
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects
    and unknown namespaces.

  • Add a new record in database table without using table maintance generator

    Hi Expart ,
                  Plz. tell me how to add new record in database table without using table maintance ganerator ....give me one ex.
    Regards
    Bhabani

    Hi,
    The other way to safely handle the modification of tables is through is by programs that can be done with SE38 or SE80.
    To insert into database table we use INSERT statement :
    1. To insert a single line into a database table, use the following:
    INSERT INTO <target> VALUES <wa>.
    INSERT <target> FROM <wa>.
    2. To insert a several lines into a database table, use the following:
    INSERT <target> FROM TABLE <itaba>.
    Or even we can use MODIFY statementas this single statement is used to insert as well as update the records of database table.
    MODIFY <target> FROM <wa>.
    or MODIFY <target> FROM TABLE <itab>.
    thanx.
    Edited by: Dhanashri Pawar on Sep 10, 2008 12:25 PM
    Edited by: Dhanashri Pawar on Sep 10, 2008 12:30 PM

  • Inserting new records into database table at runtime

    Hi all ,
    How to insert new records into database table at runtime on click update?
    Thanks.

    Hi Sasikala,
    Just for your understanding am giving a sample code snippet which you can use to read the contents of your Table UI element & save the data on to your database. Suppose you have a button up on pressing which you want to read the data from your screens table & save on to the database then you can proceed as shown below:
    1) Obtain the reference of your context node.
    2) Fetch all the data present in your table into an internal table using methods of if_wd_context_node
    3) Use your normal ABAP logic to update the database table with the data from your internal table
    In my example I have a node by name SFLIGHT_NODE and under this I have the desired attributes from SFLIGHT. Am displaying these in an editable table & the user would press up on a push button after making the necessary changes to the tables data. I would then need to obtain the tables information & save on to the database.
    data: node_sflight           type ref to if_wd_context_node,
            elem_sflight           type ref to if_wd_context_element,
            lt_elements            type WDR_CONTEXT_ELEMENT_SET,
           stru_sflight           type if_main=>element_sflight_node,
           it_flights             type if_main=>elements_sflight_node.
    "   navigate from <CONTEXT> to <SFLIGHT_NODE> via lead selection
        node_sflight_node = wd_context->get_child_node( name = 'SFLIGHT_NODE'  ).
       lt_elements = node_sflight->get_elements( ).
    "   Get all the rows from the table for saving on to the database
        loop at lt_elements into elem_sflight.
          elem_sflight->get_static_attributes( importing static_attributes = stru_sflight ).
          append stru_sflight to it_flights.
        endloop.
    " Finally save the entries on to the database
        modify ZSFLIGHT99 from table it_flights.
        if sy-subrc eq 0.
    endif.
    However a word of caution here.... SAP doesn't ever recommend directly modifying the database through an SQL query. You would preferably make use of a BAPI for the same. Try go through Thomas Jung's comments in [here|modify the data base table which is comming dynamiclly;.
    Regards,
    Uday

  • New Records in database do not show up in resultset

    Hi,
    I have seen very little on this but I have a MS Access database that I have records in. If I change one of those records, I see the change in the resultset which I am just printing out for now using System.out.println . So I add new records manually to the database just so I am some records to test with and those records do not show up in the resultset. After doing something (not exactly sure what as I did a lot), I happen to go back and then saw the new records. So I add some more and could not see those records. I AM closing my resultsets, connections, etc. I read something where someone had the same problem and thought something was being cached which seemed reasonable to me. So I tried rebooting for the heck of it and I still see only the previous records and not the new ones.
    Any ideas,
    Thanks,
    Karl

    Hi Karl,
    There are problems some times like the one you mentioned when you are using both manual and programatic inserts/updates/deletes.
    When ever u face any such problems look out for following :
    Check if all ResultSet, Statement and Connection objects are closed before exiting the code. That is normal exit and abnormal exit (due to any error/exception).
    After manual insertion save and close target table.
    If the problem still exists then try re-compiling your code after closing the your Access (*.mdb) database.
    I hope this will work for you.
    regards,
    Humayun

  • Update new record in database table

    I'm working with TestStand 4.2 and MySQL database with user-defined tables.
    There is "test_results" table with autoincrement "id" (primary index).
    I want to:
    1. write a new record to the test_results table - some data and status "Running"
    2. run a test (pass to a test sequence its "id", test uses this id for writing data to database)
    3. update the record: set execution time and update status.
    So, the steps are as below:
    1. Open database
    2. Open SQL statement: "select * from test_results".
    3. Data Operation: operation - "Set and Put", record to operate on - "New - Create New Record". In the "Column/Parameter Values" tab I set the new record values.
    Here I want to retrieve the new record "id". How to do it?
    Thanks in advance.

    I am not sure how to implement this in Test Stand, but from an SQL programming perspective, you want to run:
    SELECT @@IDENTITY
    Here is a link to the description:  http://msdn.microsoft.com/en-us/library/ms187342.aspx
    It will retrieve the record ID of the row you just inserted.

  • NetBeans Create new Record to Database, How to retrieve it?

    Hi
    I am new to java and using NetBeans and JBoss to develop a new web application now.
    I created a new "ComModule" record to "ComModule" table in database inside my servlet while clicking Add button on my web page.
    The codes are:
    ComModuleFacadeRemote comModuleFacadeRemote = this.lookupComModuleFacade();
    ComModule cm = new ComModule();
    cm.setSerialNumber(serialNo);
    cm.setMacAddress(MACAddress);
    comModuleFacadeRemote.create(cm);
    As in ComModule class, I have set the ComModule ID as sequence and primary key. So this code will add a new reocord by increasing the sequence key automatically.
    What i need to do now is to retrieve the new added record in "ComModule" table and pass it as an Object for other uses.
    e.g. I can do like this:
    ComModule cmObj = comModuleFacadeRemote.getComModuleByID(id);
    BUT the problem now is I don't know the ID of the new added record. How can I retrieve it?
    In ComModuleFacade(), the common method are CREATE, DESTROY, EDIT, FIND, FINDALL. Is there a method that I can directly retrieve a new inserted record??
    Thanks a lot for any of your help...
    Edited by: OhLei on Mar 19, 2008 12:24 AM

    Hi,
      public Long create(name,surname) throws
                SomeException{
            Person person=null;
                try{
                    person=new Person(name,surname);
                    em.persist(object);
                }catch (Exception ex){
                     throw new EJBException("create: " + ex.getMessage());
            return person.getId();  //here it will return your id
        }Person is an entity class with fields id, name, surname.
    Good Luck.

  • How to create new record with old values

    Dear all
    i have creation page with 45 fields are there
    user will enter all the fields and save it will call to non editable mode
    if user will click on change button it will call to editable mode
    in that my requirement is user wont change among those ites(45 items)clcik on save again it will call to view mode
    in that user will change any one of the value among 45 items and click on save button i need to create one more record in database
    if user wont edit any one of the field out of 45 items i dont want to create new record in database
    how can we achieve thsi functionality
    Regards
    Sreekanth

    Hi Srikant,
    When user may edit the record, the same row may get updated in vo. Thus over writing existing row instead of creating new row.
    Approach1..
    On the page where user may edit records, instead of presenting records of existing row, present copy of existing row. So
    In AM... (Later on you can put vo logic to its proper place, i.e. vo java file)
    public void viewPageCallSetup()
    Row originalRow=vo.createRow();
    Row dummyRowForEdit=vo.createRow();
    //COPY THE ORIGINAL ROW TO DUMMY ROW. IF THERE IS DIRECT METHOD TO CREATE COPY OF EXISTING ROW, THAT MAY BE MUCH BETTER.
    for(int i=0;i<vo.getAttributeCount()-1; i++)
    dummyRowForEdit.setAttribute(i, originalRow.getAttribute(i));
    vo.insertRow(dummyRowForEdit);
    vo.setNewRowState(Row.STATUS_INITIALIZED);
    vo.setCurrentRow(dummyRowForEdit);
    call this method in contoller's processRequest..
    string oid=pagecontext.getparameter("oid");
    if(pageContext.getparameter("Purpose").equals("Edit")) //Means user clickED the edit button so we need to replicate the row
    am. viewPageCallSetup(oid); //calling this method in am
    else
    In PFR...
    if(pageContext.getparameter("Purpose").equals("Edit"))
    am.xxcostedit(oid); //calling this method in am
    in case user selects "Cancel" on edit form,we need to remove the duplicate row. So in AM write a method to remove the duplicate rowd on click of "Cancel" button on edit form.
    Rest of the logic is same for "Save" button. Just say commit.
    Abdul Wahid

  • Form does not show "new" records from SQL Database

    I have a PDF form that pulls data from a SQL Server.  The fields in
    the PDF are populated from the database after selecting a specific
    record from a drop down and then clicking on a button labeled "Fill".
    The problem is that the dropdown does not display new records that
    have been recently added to the database.  I have to open the form up
    in designer then save it, (*note - I change nothing at this point.)
    Then when the form is opened back up in Adobe the dropdown show all
    the records including the new ones.  I even put a manual refresh on
    form to try and fix this an it did not help. Seriously stumped.
    Any help is greatly appreciated.
    Here is my code for the dropdown.
    ++++++++++++++++++++++++++++
    topmostSubform.Page1.JobSelect::initialize - (JavaScript, client)
    var sDataConnectionName = "BBCC"; // example - var sDataConnectionName
    = "Test";
    var sColHiddenValue = "ContractAdmin_Key"; // example - var
    sColHiddenValue = "Dept_ID";
    var sColDisplayText = "JobDescription"; // example - var
    sColDisplayText = "Dept_ID"
    // Search for sourceSet node which matchs the DataConnection name
    var nIndex = 0;
    while(xfa.sourceSet.nodes.item(nIndex).name != sDataConnectionName)
    nIndex++;
    var oDB = xfa.sourceSet.nodes.item(nIndex);
    oDB.open();
    oDB.first();
    // Search node with the class name "command"
    var nDBIndex = 0;
    while(oDB.nodes.item(nDBIndex).className != "command")
    nDBIndex++;
    // Backup the original settings before assigning BOF and EOF to stay
    var sBOFBackup =
    oDB.nodes.item(nDBIndex).query.recordSet.getAttribute("bofAction");
    var sEOFBackup =
    oDB.nodes.item(nDBIndex).query.recordSet.getAttribute("eofAction");
    oDB.nodes.item(nDBIndex).query.recordSet.setAttribute("stayBOF",
    "bofAction");
    oDB.nodes.item(nDBIndex).query.recordSet.setAttribute("stayEOF",
    "eofAction");
    // Clear the list
    this.clearItems();
    // Search for the record node with the matching Data Connection name
    nIndex = 0;
    while(xfa.record.nodes.item(nIndex).name != sDataConnectionName)
    nIndex++;
    var oRecord = xfa.record.nodes.item(nIndex);
    // Find the value node
    var oValueNode = null;
    var oTextNode = null;
    for(var nColIndex = 0; nColIndex < oRecord.nodes.length; nColIndex++)
    { if(oRecord.nodes.item(nColIndex).name == sColHiddenValue)
    { oValueNode = oRecord.nodes.item(nColIndex); } else
    if(oRecord.nodes.item(nColIndex).name == sColDisplayText) { oTextNode
    = oRecord.nodes.item(nColIndex); } }
    while(!oDB.isEOF())
      this.addItem(oTextNode.value, oValueNode.value);
       oDB.next();
    // Restore the original settings
    oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sBOFBackup,
    "bofAction");
    oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sEOFBackup,
    "eofAction");
    // Close connection
    oDB.close();
    ++++++++++++++++++++++
    Here is code for the refresh button
    +++++++++++++++++++++
    topmostSubform.Page1.Button27::click - (JavaScript, client)
    sourceSet.BBCC.requery();
    +++++++++++++++++++++

    pguerett wrote:
    The other thing that might be happening is a refresh issue on the DropDownList. Try adding the command xfa.layout.relayout() after the database connection has been closed.
    Paul
    Good catch Paul!  Would you believe that I have been trying to get this resolved for almost two years! Works perfect now.
    Thank you,
      - Eric

  • Problem with a primary key when creating a new record in Forms

    My table has a field - MDD_KEY - that is a primary key. It is updated from a sequence with a before-insert database trigger. I know this works properly as the primary key was accurately populated when I inserted 1433 records.
    In Forms 6, I have a form based on that table. I have set the mdd_key as a hidden field because I assume it will be entered by the before-insert trigger. However, when I enter data into the table, and then try to save it, I get a FRM-40202: Field must be entered. - followed by - FRM-40222: Disabled item MDD_KEY failed validation.
    If I set DATA Required to no, when I try to save I get an FRM-40600: Record has already been inserted - but no such record exists in the database. I know this record is unique and does NOT exist because I deliberately made it up.
    In the property palatte, the attributes of the field are:
    DATA Data Type Number
    Required Yes
    DATABASE Database Item Yes
    Primary Key Yes
    Query Only No
    Query Allowed Yes
    Query Length 0
    Insert Allowed Yes
    Update Allowed Yes
    Update Only if Null No
    Lock Record No
    I assume that my problem is that with a new record, the form wants to see the MDD_KEY populated before it saves - but that isn't going to happen until the before insert trigger fires in the database. I assume I have to populate that field within forms, but how do I do that without messing up the database trigger/sequence? I will have to load more data directly into the database - so I need the database trigger in place.
    I have not used primary keys before so I am more than a little bit confused about how and when it should be populated when a new record is created in Forms.
    Any help would be appreciated as I cannot enter new data into my form (works well with existing data).
    Thanks
    Glenn

    hi
    if u have any problem using seq then try that statemetn ur block level in ur form
    PRE-INSERT trigger
    select nvl(max(nvl(srno,0)),0)+1 into :srno from tablename;
    Rizwan

  • Inserting a new record in  a database

    Hi,
    In my program I have to add a new record in a database. The problem is that one of the column of the database is a MEDIUMBLOB, and I have to put into that column an array of byte ( that I can convert into an InputStream ).
    How can I do?

    To insert Blob data (an array of byte called "data") I tryed the following code; the blob colomn is called "column2" and the table(called "myTable") has only another column ("column1"), a column of String:
    InputStream inp = new ByteArrayInputStream(data);
    stmt.executeUpdate("insert into myTable (column1)
    values( ' value1' ); " );
    ResultSet res = stmt.executeQuery("select column2 from myTable");
    res.updateBlob("data", inp);The problem is that I have the following error:
    Exception in thread "AWT-EventQueue-0" java.lang.AbstractMethodError: >com.mysql.jdbc.ResultSet.updateBlob(Ljava/lang/String;Ljava/io/InputStream;)V

  • Alerting about new records in to the database (in perticular table).

    Dear membsers,
    Alerting about new records in to the database (in perticular table).
    i have a sample application like this.
    A form based on purchase_requisitions, the data being entered from a network computer by a user with datanetry privileges. let's say the columns are
    req_id,req_date,red-from_dept,req_from_emp,req_item_req_qty,req_status. (initially by default req_status is 'NEW').
    next..
    i have a form based on Pending_requisitions_view for the managers who approves the requisitions, the columns are just req_date,req_from_dept,req_from_emp. all the pending requisitions will come here every 5 minitues it gets refreshed by a timer. and it is a multi record block. from here the manager selects the record and he changes the status to APPROVED or DENIED. this is common scenario.
    here is the main problem, the manager has to keep open his form all the time, or if he is working on any other things/forms, it is not possible for him to see requisiotns unless he has to open that form and timer re-freshes the records then only he can see. and again when the application in minimised state we cant see any updates/new entries into requissitions.
    im trying to make a full pledges online system. im using Oracle 8i,forms 6i under win 2000.
    is there any possibility if there is any new records gets into that table we can have alerts like Yahoo messenger it changes color to Blue when it gets new message if it is minimised state.
    Please im keen to get this type of environment.
    Thanks in advance

    Hi,
    i tested like this,
    create a table-1 with tow coumns
    table-2 clone to table-1, on table-1 i put on-insert trigger insert into table-2. so far it is good, table-2 is getting values.
    on table-2 i wrote a database trigger like this
    CREATE.. ON INSERT on each row..
    begin
    IF INSERTING THEN
    raise_application_error;
    END IF;
    end;
    now the data not at all getting inserted into any table raising_application_error, so i could not proceed into further..
    please advise me..
    Thanks a lot

  • Problem When deleting record from database

    Hi ,
    I have a question. Firstly I'm using VB
    I have a problem about deleting any record from access database , That's the code I'm use it for add new item and it's work but it's not work when I tried to edit any rows " it's not want to Save" but work for add new Item.
    Try
    Me.Validate()
    Me.CustomerBindingSource.EndEdit()
    Me.CustomerTableAdapter.Update(Me.KonoDataSet.Customer)
    MsgBox("Update Successful")
    Catch ex As Exception
    MsgBox("Update Failed")
    End Try
    And That's my code for Deleting any record from database But it's not work and that's a problem.
    CustomerBindingSource.RemoveCurrent()
    CustomerBindingSource.EndEdit()
    Me.CustomerTableAdapter.Update(Me.KonoDataSet.Customer)
    Can anybody help me about that issue ?

    Hi kono20006000,
    Your issue seems really strange. I would recommend you make a troubleshooting.
    1.Made sure your code works with the single copy of the database. You could check if it scans hard drive for the database file name and check if it modifies dates on found files. You could check if you operate with the same database.
    2. Use the application update the record at the form_load event to see if it would work correctly.
    3.Check the table in update statement and the table in add statement.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • Updating records in the database problem...

    hi, hello to all members, my problem is this, i can't update my records, my table name is UsrTable with a two fields only, which UsrName and Password. all i want to do is when the user wants to sign up and enters there username and password the database will be updated of the new record. i paste the sorce code in here to make it precise co'z i cant figure out how to update the database, sorry if the coding is too long and not good , im just a beginner in JAVA especially using JDBC.
    ****START CODE*****
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.sql.*;
    public class SignIn extends JFrame
    private JPanel jInput;
    private JPanel jButton;
    private JButton Savebtn,Exitbtn;
    private JLabel userlbl,passlbl,connectionLabel;
    private JTextField Usertxt;
    private JPasswordField Passtxt;
    public static final String DRIVER = "sun.jdbc.odbc.JdbcOdbcDriver";
    public static final String url = "jdbc:odbc:UserInfo";
    public static final String DATABASE = "\\User.mdb";
    private Connection connect ;
    public String tmpUser,tmpPass,query;
    public SignIn()
    super("Create your Account..");
    setResizable(false);
    ImageIcon imgIcon = new ImageIcon("c:/JavaCourseware/Images/cdicon.jpg");
    this.setIconImage(imgIcon.getImage());
    addWindowListener(new WindowAdapter()
    { // Opens addWindowListener method
    public void windowClosing(WindowEvent e)
    { // Opens windowClosing method
    int result;
    result = JOptionPane.showConfirmDialog( null,"Are you sure you want to exit?",
    "Confirmation Required...", JOptionPane.YES_NO_OPTION );
    if(result == JOptionPane.YES_OPTION)
    System.exit(0);
    else
    return;
    } // Closes windowClosing method
    }); // Closes addWindowListener method
    try
    InitComp();
    catch(Exception e)
    public void InitComp() throws Exception
    Usertxt = new JTextField(15);
    Passtxt = new JPasswordField(15);
    connectionLabel = new JLabel();
    userlbl = new JLabel("Enter your username: ");
    passlbl = new JLabel("Enter your password: ");
    Savebtn = new JButton("Save");
    Exitbtn = new JButton("Exit");
    this.setSize(new Dimension(320,150));
    this.setLocationRelativeTo(null);
    this.getContentPane().setBackground(Color.blue);
    connectionLabel.setForeground(Color.YELLOW);
    connectionLabel.setBackground(Color.BLUE);
    connectionLabel.setFont(new Font("Arial", Font.PLAIN , 12));
    buildTxtInput();
    buildBtn();
    this.getContentPane().add(connectionLabel,BorderLayout.NORTH);
    this.getContentPane().add(jInput,BorderLayout.CENTER);
    this.getContentPane().add(jButton,BorderLayout.SOUTH);
    //make a connection
    try
    //url = "jdbc:odbc:UserInfo";
    Class.forName(DRIVER);
    connect = DriverManager.getConnection(url);
    connectionLabel.setText("You have made a successful connection to: " + DATABASE);
    catch(ClassNotFoundException cnfx)
    cnfx.printStackTrace();
    connectionLabel.setText("Connection unsuccessful" + cnfx.toString());
    catch (SQLException sqlx)
    sqlx.printStackTrace();
    connectionLabel.setText("Connection unsuccessful" + sqlx.toString());
    catch (Exception ex)
    ex.printStackTrace();
    connectionLabel.setText("Connection unsuccessful" + ex.toString());
    Savebtn.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent e)
    try
    Statement state = connect.createStatement();
    if (Usertxt.getText().equals("") && Passtxt.getText().equals(""))
    connectionLabel.setText("Invalid Input!");
    JOptionPane.showMessageDialog( null, "Invalid Entry", "Saving Abort...", JOptionPane.INFORMATION_MESSAGE );
    state.close();
    else
    state.executeUpdate("INSERT INTO UsrTable" +
    "VALUE UsrName = '" +
    Usertxt.getText() +"' AND Password = '" +
    Passtxt.getText() +"'");
    JOptionPane.showMessageDialog(null, "Your account is already created!","Thank you...",
    JOptionPane.INFORMATION_MESSAGE);
    state.close();
    catch (SQLException sqlex)
    sqlex.printStackTrace();
    connectionLabel.setText(sqlex.toString());
    });//end of Save Listener
    public static void main(String args[])
    SignIn Signfrm = new SignIn();
    Signfrm.show();
    private void buildTxtInput()
    jInput = new JPanel();
    jInput.setLayout( new GridLayout(2, 2, 0, 10) );
    //user.setForeground(Color.yellow);
    jInput.setBorder(BorderFactory.createTitledBorder(""));
    //pass.setForeground(Color.yellow);
    jInput.add(userlbl);
    jInput.add(Usertxt);
    jInput.add(passlbl);
    jInput.add(Passtxt);
    private void buildBtn()
    jButton = new JPanel();
    jButton.setLayout( new GridLayout(1, 1, 10, 10) );
    jButton.setBorder(BorderFactory.createRaisedBevelBorder());
    jButton.add(Savebtn);
    jButton.add(Exitbtn);
    }//end of class
    ***END PROGRAM***
    im hoping there's someone can help me with this, co'z im badly need it.thanks..again,

    hi! i followed your code, but i get a different error i dont know what is the meaning of error, first heres my code i write...thanks for the fast reply co'z i badly need it.
    Savebtn.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent e)
                   String password = new String (Passtxt.getPassword());
    if (IDtxt.getText().equals ("")) {
                        JOptionPane.showMessageDialog (null, "Member's Id not Provided.");
                        IDtxt.requestFocus();
    else if (Usertxt.getText().equals ("")) {
                        Usertxt.requestFocus();
                        JOptionPane.showMessageDialog (null, "Username not Provided.");
                   else if (password.equals ("")) {
                        Passtxt.requestFocus();
                        JOptionPane.showMessageDialog (null, "Password not Provided.");
                   else {
                        try {     //INSERT Query to Add Book Record in Table.
                             String q = "UPDATE UsrTable "+"SET UsrName = '"+Usertxt.getText() + "' " +
    "AND Password = '" + password + "'"+"WHERE ID = '" + ID + "'";
                             int result = st.executeUpdate(q);                              if (result == 1) {               .
                                  JOptionPane.showMessageDialog (null, "New User has been Created.");
                                  Usertxt.setText ("");
                                  Passtxt.setText ("");
                                  Usertxt.requestFocus ();
                             else {                                                        JOptionPane.showMessageDialog   (null, "Problem while Creating the User.");
                                  Usertxt.setText ("");
                                  Passtxt.setText ("");
                                  Usertxt.requestFocus ();
                        catch (SQLException sqlex) { }
    and heres the error...
    java.lang.NullPointerException
    at CreateAcc$3.actionPerformed(CreateAcc.java:179)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
    at java.awt.Component.processMouseEvent(Component.java:5100)
    at java.awt.Component.processEvent(Component.java:4897)
    at java.awt.Container.processEvent(Container.java:1569)
    at java.awt.Component.dispatchEventImpl(Component.java:3615)
    at java.awt.Container.dispatchEventImpl(Container.java:1627)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
    at java.awt.Container.dispatchEventImpl(Container.java:1613)
    at java.awt.Window.dispatchEventImpl(Window.java:1606)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

  • Problem with inserting new records in Oracle Forms

    Hi Friends,
    I am a new user to Oracle Forms and I need a help from you people. The problem is as follows:
    I have a data block in which I can display a number of records. In this data block the user will be able to edit the fields if no child records are found in another table. I have used when-new-record-instance to attain this scenario. All are text items. One item licensee_id which is made invisible by setting the property in property palette and required=no ( as this is the primary key of the table). Also the audit columns are made invisible.
    The code for it is as follows:
    DECLARE
         v_alert_button NUMBER;
         v_cnt                          NUMBER;
    BEGIN
         SELECT COUNT (*)
    INTO v_cnt
    FROM id_rev_contracts
    WHERE licensee_id = :ID_REV_LICENSEES.licensee_id;
    IF v_cnt > 0 THEN
    set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', UPDATE_ALLOWED, PROPERTY_FALSE);
    ELSE
         set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', UPDATE_ALLOWED, PROPERTY_TRUE);
         -- set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', INSERT_ALLOWED, PROPERTY_TRUE);
    END IF;
    END;
    Now in this data block I should also be able to insert new records and for the same I have used PRE-INSERT trigger and the code for it is as follows:
    DECLARE
         v_alert_button NUMBER;
    CURSOR v_licensee_id IS SELECT id_rev_licensees_s.NEXTVAL FROM dual;
    BEGIN
    OPEN v_licensee_id;
    FETCH v_licensee_id INTO :id_rev_licensees.licensee_id;
    CLOSE v_licensee_id;
    IF :id_rev_licensees.licensee_id IS NULL THEN
    Message('Error Generating Next v_licensee_id');
    RAISE Form_Trigger_Failure;
    END IF;
    :ID_REV_LICENSEES.created_by := :GLOBAL.g_login_name;
    :ID_REV_LICENSEES.last_updated_by := :GLOBAL.g_login_name;
    :ID_REV_LICENSEES.create_date := SYSDATE;
    :ID_REV_LICENSEES.last_update_date := SYSDATE;
    EXCEPTION
    WHEN form_trigger_failure
    THEN
    RAISE form_trigger_failure;
    WHEN OTHERS
    THEN
    v_alert_button :=
    msgbox ('ERROR in Pre-Insert - ' || SQLERRM, 'STOP', 'Contact IST');
    RAISE form_trigger_failure;
    END;
    Every thing is compiling fine but at the run time when I am trying to insert a new record I am receiving the following error:
    FRM-40508:ORACLE error:unable to insert record
    I also think the pre-insert record is not firing at the time of inserting a new record and saving it. So I request you to please delve into this problem and suggest me how to overcome this problem. Code snippets would do more help for me. If you need any other things from me please let me know. I will see if I could be of any help in that concern because I may not be able to send the entire form as it is.
    Thanks and regards,
    Vamsi K Gummadi.

    first of all
    pre-insert fires after the implicit/explicit commit/commit_form is issued and before the real insert is submitted to the db.
    i would suggest to remove the error handling part for the moment
    because i believe you might be getting "ora-xxxx cannot insert null"
    and also make visible the primary column to check if the pre-insert is executed.
    it would be better to make visible for a while the not null columns of the table/block
    i suppose that the block is insert allowed and you are using table as the source of the block and not any procedures or something...

Maybe you are looking for