Wrox Programmer Forums
|
BOOK: Beginning JavaScript
This is the forum to discuss the Wrox book Beginning JavaScript by Paul Wilton; ISBN: 9780764544057
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning JavaScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 14th, 2006, 01:58 AM
Registered User
 
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Too Few Parameters Error

Hello,

I am fairly new to JavaScript and to SQL, and I seem to be having some trouble with the following code.

var mySQL = "UPDATE Playerlist SET PlayerHP = PlayerHP + 10, PlayerGold = Gold WHERE PlayerNumber = MaxPlayerNumber";
adoConnection.Execute (mySQL);

Playerlist is the name of my table.
PlayerHP and PlayerGold are names of columns in the table.
Gold and MaxPlayerNumber are variables containing integers.

When I run the code I get an error telling me that there are too few parameters, but it seems to work fine if I enter in numbers in place of the variables.

I tried checking the spelling and it all seems to be correct.

Does anyone have any ideas?

Thanks in advance for any assistance you guys can give.

 
Old June 19th, 2006, 04:11 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii dcameron!!

Check your -->PlayerGold = Gold to PlayerGold = 'Gold'

i.e.

var mySQL = "UPDATE Playerlist SET PlayerHP = PlayerHP + 10, PlayerGold = 'Gold' WHERE PlayerNumber = MaxPlayerNumber";
adoConnection.Execute (mySQL);

hope this will help you

Cheers :)

vinod





Similar Threads
Thread Thread Starter Forum Replies Last Post
Parameters Dharam80 Access 3 August 19th, 2005 01:59 PM
Runtime Error 3061 - too few parameters Raymie_C Access VBA 14 July 18th, 2005 04:19 AM
Error:0x80040E10 -Too few parameters. expected 1 mikest Access ASP 2 December 5th, 2004 10:31 PM
Error "Too Few Parameters - Expected 1" timmaher Access VBA 2 August 31st, 2004 04:04 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.