Click to See Complete Forum and Search --> : Updating a record without a form


stuffandthings
10-17-2006, 10:36 AM
Hi, Please bear with me, i'm fairly new to this. I am trying to create a page where a user can enter a given code and click a button to see if they win a prize. Much like a lottery. The winning codes are to be held in an access database. So far, I have created it so that when the user enters the code and clicks the submit button a new .asp page containing the script is called. In here i have created a recordset that contains only the winning number if it exists. The person is then redirected to a relevent 'congrats' or 'unlucky' page. This works fine. The problem is if a winning number is entered, i have to update a field in the database to flag that that number has been claimed (to prevent someone else using that code). I tried to create a hidden form and use the 'update record' DreamWeaver Server Behaviour but this does not work without user interaction (submit button).

Any suggestions on how i can update the record would be most gratefully accepted :)

Terrorke
10-17-2006, 10:39 AM
Try it on you congrats page.
When this page is called pas the entered number to it and execute a sql query to update your database.

stuffandthings
10-17-2006, 11:20 AM
Thanks for replying so quickly. I managed to get it to work by writing an sql query in my script. When i say i wrote it, i mean i found the DreamWeaver 'command (stored procedure)' functionality! I really need to take the time out to learn how to hand code this stuff!!

Many thanks again.