Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

auto submit keeps repeating

Options
  • 14-04-2003 10:53am
    #1
    Closed Accounts Posts: 10


    I have an asp page that inserts a record into a database, taking values posted to it from another page. This works fine when I click the submit button on the form.

    However, I want to automate the record insertion, so that I only need to call the page, with the correct parameters. I have put "onload =document.myform.submit() " and this works, but it keeps repeating, ie inserting records all the time, the second and subsequent records being blank (no values posted)

    how do i stop the insert repeating? does an insert call the page load event? is there any other way of automatically inserting a record


Comments

  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Originally posted by Dell Boy
    how do i stop the insert repeating?
    Use a counter, pass it in you repeating form - if you're limited to JavaScript, then you might pass it in the querystring and check it via document.location.search
    does an insert call the page load event?
    No. The database insert occurs on the server, the page load occurs on the client.
    is there any other way of automatically inserting a record
    Lots of other ways - depends on your setup and your requirements.


  • Closed Accounts Posts: 10 Dell Boy


    my setup is asp web host, limited to javascript, and an access database, which we will migrate to sql server once transactions reach critical mass.

    I have an application (vb) running offline, that needs to append a record to a web hosted database every so often, at the moment hundreds of appends / day, not thousands.

    I intended to call the insert page from vb which would automatically update the online db.

    I'm testing the autoinsert by calling the insert page from another web page, which posts in the data to be inserted.

    The intention is to have the whole lot online in the future, but for now, we're limited to the current setup.

    If there is some neater way of doing this, I'd appreciate some feedback.


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    There are lots of neater ways of doing what you're trying to do, just depends on what your skillsets are and how much you're willing to spend.

    However, for your case, I would suggest you bypass the HTML form. All that is doing is sending data, probably via HTTP POST, to an asp handler, which then populates the database. Have your VB app emulate the HTTP POST and bypass the need for JavaScript, HTML, etc. To do this you would best use the VB Winsock control (plenty of examples out there to Google).


Advertisement