Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2004
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBScript: Can i update the database this way?

    Hi, Im doing VBScript and Im trying to update the Access DB.

    I have a table Quota and I want to update it with the following information.




    set rs = conn.execute("select * from Quota")

    dim x = rs("quota") <----A
    dim y = Request.Form("po_amt") <----B

    dim quotaLeft = x - y

    conn.execute("update Quota set quota = "& quotaLeft &"")




    Request.Form is what the user had entered.

    But i keep getting a compilation error :"Expected End Of Statement" for both of the declared statements A & B

    How am I supposed to declare them? I need the information to update the table. Is there any other way? or This cannot be done?

    Plss...help ?

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts

    Re: VBScript: Can i update the database this way?

    Try:

    dim x,y,quotaLeft
    x = rs("quota")
    y = Request.Form("po_amt")
    quotaLeft = x - y

    in asp, you cannot dimension and assign a value to a variable in one statement
    I am the luckiest man in the world

  • #3
    New Coder
    Join Date
    Jan 2004
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey thanks, That does the trick...Simple solution actually, I should had thought of trying that out first...But i didnt cos I could do that in Java so i assumed that it was possible across all languages...Guess my ASP knowledge is still not very good haha...

    Anyways, THANKS


  •  

    Posting Permissions

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