This topic is locked
[SOLVED]

 Update records in Users Table

2/11/2014 3:50:04 PM
ASPRunnerPro General questions
J
jmccullough author

Hello, I have an Joint Purchasing database and I have Vendors who logon and place Bids on the items listed. Upon completion of entering all of their bids I would like to have a button (Finalize your Bids) that when clicked, will update their password in the Userstbl to "XXXXXXX" so that they cannot log back in to change their bids.
Any help would be appreciated. Am using ASPRunner Pro 7.2.
Thank you

Sergey Kornilov admin 2/14/2014

Something like this will work:

CustomQuery("update Userstbl set PasswordField='xxxxx' where UsernameField='" & Session("UserID") & "'")


Where PasswordField and UsernameField are fields that store password and username respectively.

G
gonzalosb 3/4/2014

Hi Sergey,

I’m trying to use this code to update selected fields on the list page an set to 1



dim sql, record
DoAssignment record, button.getNextSelectedRecord()
do while isObject(record)
sql = "Update Records set AddedToAchive='1' where ID='" & record("ID") & "'"
dbConnection.Execute sql
DoAssignment record, button.getNextSelectedRecord()
loop
result("txt") = "Records were updated."


i copy this code from ASP manual
my problem is that when i use only

sql = "Update Records set AddedToAchive='1'



update all the records on the database with no exceptions but when i add

where ID=' & record(ID)'"



Gives an error

Microsoft Office Access Database Engine error'80040e07'

data type mismatch in criteria expression

/buttonhandler.asp, line 105


line 105 is " dbConnection.Execute sql "
please help

Sergey Kornilov admin 3/4/2014

record(ID) is incorrect, record("ID") is correct.

G
gonzalosb 3/7/2014

now i have this error



Microsoft VBScript runtime error '800a00d'
Type mismatch: 'Key"
/include/aspfunctions.asp, line 2984



line 2984 on ASPR 8.0

line 2886 on ASPR 7.1

witch is:



ArrayElement=mid(p_arr,key+1,1)
Sergey Kornilov admin 3/7/2014

Print your SQL query on the page instead of executing it to see if there are any errors in it.

G
gonzalosb 3/11/2014

ok, found the code that works for me.



sql = "Update Records set AddedToAchive='1' where ID=" & record("ID")


thanks