Results 1 to 3 of 3

Thread: Little Problem...

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2000
    Posts
    29

    Question

    Hi, if if click on the button "back (Zurueck)" then the programm says:

    "com.ms.wfc.data.AdoException: Operation is not allowed in this context.
    at com/ms/wfc/data/Recordset.movePrevious (Recordset.java)

    *** The rest of the error-message...

    at frmVFV3_1.cmdZurueck_click (frmVFV3_1.java:100)
    at com/ms/wfc/core/EventHandler.invoke (EventHandler.java)
    at com/ms/wfc/core/Component.fireEvent (Component.java)
    at com/ms/wfc/ui/Control.onClick (Control.java)
    at com/ms/wfc/ui/Button.onClick (Button.java)
    at com/ms/wfc/ui/Button.wndProc (Button.java)
    at com/ms/wfc/ui/Control$ControlWindow.wndProc (Control.java)
    at com/ms/wfc/app/Window.callback (Window.java)
    at com/ms/wfc/win32/Windows.SendMessage (Windows.java)
    at com/ms/wfc/ui/Control.sendMessage (Control.java)
    at com/ms/wfc/ui/Control.reflectMessage (Control.java)
    at com/ms/wfc/ui/Control.wmCommand (Control.java)
    at com/ms/wfc/ui/Control.wndProc (Control.java)
    at com/ms/wfc/ui/GroupBox.wndProc (GroupBox.java)
    at com/ms/wfc/ui/Control$ControlWindow.wndProc (Control.java)
    at com/ms/wfc/app/Window.callback (Window.java)
    at com/ms/wfc/win32/Windows.CallWindowProc (Windows.java)
    at com/ms/wfc/app/Window.defWndProc (Window.java)
    at com/ms/wfc/ui/Control$ControlWindow.defWndProc (Control.java)
    at com/ms/wfc/ui/Control.defWndProc (Control.java)
    at com/ms/wfc/ui/Control.wmMouseUp (Control.java)
    at com/ms/wfc/ui/Control.wndProc (Control.java)
    at com/ms/wfc/ui/Button.wndProc (Button.java)
    at com/ms/wfc/ui/Control$ControlWindow.wndProc (Control.java)
    at com/ms/wfc/app/Window.callback (Window.java)
    at com/ms/wfc/win32/Windows.DispatchMessage (Windows.java)
    at com/ms/wfc/app/Application$ThreadContext.runMessageLoop (Application.java)
    at com/ms/wfc/app/Application.run (Application.java)
    at frmVFV3_1.main (frmVFV3_1.java:860)"


    ******


    *** Thats the sourcecode...

    import com.ms.wfc.app.*;
    import com.ms.wfc.core.*;
    import com.ms.wfc.ui.*;
    import com.ms.wfc.html.*;
    import com.ms.wfc.data.*;
    import com.ms.wfc.data.ui.*;

    public class frmVFV3_1 extends Form
    {
    public Recordset adoRecHaupt = new Recordset();
    public Connection adoConHaupt = new Connection();
    public DataBinder adoDbHaupt = new DataBinder();

    public frmVFV3_1()
    {
    initForm();

    adoConHaupt.setConnectionString("dsn=Microsoft Access-Datenbank;uid=;pwd=;DBQ=C:\\Vb\\VFV3\\prj\\Dat\\VFV.mdb");
    adoConHaupt.open();

    adoRecHaupt.setActiveConnection(adoConHaupt);
    adoRecHaupt.setSource("SELECT * FROM Titel;");
    adoRecHaupt.open();

    adoDbHaupt.setDataSource(adoRecHaupt);

    adoDbHaupt.setBindings(new DataBinding[] {
    new DataBinding(txtTitel, "text", "Titel"),
    new DataBinding(txtLaufendeNummer, "text", "LaufendeNummer"),
    new DataBinding(txtDarsteller, "text", "Darsteller"),
    new DataBinding(cboHerstellungsLand, "text", "Herstellungsland"),
    new DataBinding(cboRegisseur, "text", "Regisseur"),
    new DataBinding(cboGenre, "text", "Genre"),
    new DataBinding(cboHerstellungsDatum, "text", "Herstellungsdatum"),
    new DataBinding(cboMedium, "text", "Medium"),
    new DataBinding(cboHersteller, "text", "Hersteller"),
    new DataBinding(cboOriginalAufgenommen, "text", "OriginalAufgenommen"),
    new DataBinding(cboFarbe, "text", "FarbeSW"),
    new DataBinding(txtLaufzeitInMinuten, "text", "LaufzeitMinuten"),
    new DataBinding(cboFsk, "text", "Fsk"),
    new DataBinding(cboTon, "text", "Tonwiedergabe"),
    new DataBinding(txtInformationen, "text", "Informationen"),
    new DataBinding(cboVerliehenAn, "text", "VerliehenAN"),
    new DataBinding(cboVerliehenAm, "text", "VerliehenAM"),
    new DataBinding(cboMitgliedsNr, "text", "Mitgliedsnummer"),
    new DataBinding(txtPfadZumClip, "text", "ClipVerzeichnis") } );

    txtTitel.setEnabled(true);
    txtLaufendeNummer.setEnabled(true);
    txtDarsteller.setEnabled(true);
    cboHerstellungsLand.setEnabled(true);
    cboRegisseur.setEnabled(true);
    cboGenre.setEnabled(true);
    cboHerstellungsDatum.setEnabled(true);
    cboMedium.setEnabled(true);
    cboHersteller.setEnabled(true);
    cboOriginalAufgenommen.setEnabled(true);
    cboFarbe.setEnabled(true);
    txtLaufzeitInMinuten.setEnabled(true);
    cboFsk.setEnabled(true);
    cboTon.setEnabled(true);
    txtInformationen.setEnabled(true);
    cboVerliehenAn.setEnabled(true);
    cboVerliehenAm.setEnabled(true);
    cboMitgliedsNr.setEnabled(true);
    txtPfadZumClip.setEnabled(true);
    }

    public void dispose()
    {
    super.dispose();
    components.dispose();
    }

    private void tmr1_timer(Object source, Event e)
    {
    Time now = new Time();
    txtDatum.setText(now.formatShortDate());
    txtUhr.setText(now.formatLongTime());
    }

    private void cmdVor_click(Object source, Event e)
    {
    if (adoRecHaupt.getEOF())
    ;
    else
    adoRecHaupt.moveNext();
    }

    private void cmdZurueck_click(Object source, Event e)
    {
    //if (adoRecHaupt.getBOF())
    //;
    //else if (adoRecHaupt.getEOF())
    //adoRecHaupt.movePrevious();
    //else
    adoRecHaupt.movePrevious();
    }

    What have I done wrong (The Recordset is not at BOF or so, the error appears everytime i click on the button back (zurueck))?? Please help anyone,
    thanx, MAJA.
    VB and Java are great - ja, so ist es !! To my software programming site: http://www.majasoft-games.de .

  2. #2
    Fanatic Member Psyrus's Avatar
    Join Date
    Jul 2000
    Location
    NJ
    Posts
    602
    Try setting the CursorType property to adOpenDynamic or the Java Equivalent. Sorry I'm not sure of the proper syntax but the error that you are getting sounds like a ForwardOnly cursor is being used.
    Chris

    VB 6.0 Calendar App Video Gamers Group
    Don't forget to rate people if they helped you.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2000
    Posts
    29

    Thumbs up Now it works...

    Thanx for help... I set the cursor-type to dynamic and the look-type to optimistic, and the result is a fine working procedur.

    Thank You verry much, MAJASOFT.
    VB and Java are great - ja, so ist es !! To my software programming site: http://www.majasoft-games.de .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width