Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Too few parameters. Expected 2.

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Conn.execute ("UPDATE Student_Data SET Student_Data.Password = " & "Newpassword" & " WHERE (((Student_Data.UserID)=" & "student1" & "))")

Can any see why I get the above error message.
 
hai
i think ur conn object is for connection like this
Set myconn=Server.CreateObject("adodb.connection")
and u open the dsn with this command.
conn.open dsn
the error in ur code is u left some "'" for the string variables.i think u know that for sql query the string variable requires "'" single codes.

i think this code will work
Conn.execute ("UPDATE Student_Data SET Student_Data.Password = '" & "Newpassword"&"' WHERE (((Student_Data.UserID)='"&"student1"&"'))")


bye
raghu
 
Thanks for your response, I had managed to put my thinking head on and come up with a solution, that was very similar to yours.

Cheers

Up the Glovers
 
This is an error that does not have any link with the cause.
Rewrite the string like:

Conn.Execute ("UPDATE Student_Data SET Password = " & "Newpassword" & " WHERE UserID=" & "student1")

Also check the names of the field to be exactly the same
Password,UserID (case sensitive).

hope this helps, s-)

Blessed is he who in the name of justice and good will, shepards the week through the valley of darkness...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top