hi I get this error message in withdraw_money.asp, plz someone help
thanks in advance
here are the error details
Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'Update'
withdraw_money.asp, line 30
here is my code:
==================
<%
userName =Request("name"
dim sql
Set myCon = Server.CreateObject("ADODB.Connection"
okay = "driver={Microsoft Access Driver (*.mdb)}; " &_
"DBQ=" & Server.Mappath("client_details.mdb" & ";"
myCon.Open okay
Set RS = Server.CreateObject("ADODB.RecordSet"
'RS.ActiveConnection = myCon
sql="SELECT cl_balance FROM my_table WHERE cl_name =' "&userName &" ' ;"
RS.Open sql , myCon, adLockOptimistic
balance = RS("cl_balance"
withdraw = request("amount"
balance = balance - withdraw
if balance > withdraw then
RS("cl_balance"=balance
Response.Write("transaction successful"
else
Response.Write("transaction unsuccessful"
end if
RS.Update
============== line 30
RS.MoveNext
RS.Close
%>
<%WHILE NOT RS.EOF%>
<%Response.Write(RS("cl_balance")%>
<%RS.MoveNext
WEND
myCon.Close%>
thanks in advance
here are the error details
Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'Update'
withdraw_money.asp, line 30
here is my code:
==================
<%
userName =Request("name"
dim sql
Set myCon = Server.CreateObject("ADODB.Connection"
okay = "driver={Microsoft Access Driver (*.mdb)}; " &_
"DBQ=" & Server.Mappath("client_details.mdb" & ";"
myCon.Open okay
Set RS = Server.CreateObject("ADODB.RecordSet"
'RS.ActiveConnection = myCon
sql="SELECT cl_balance FROM my_table WHERE cl_name =' "&userName &" ' ;"
RS.Open sql , myCon, adLockOptimistic
balance = RS("cl_balance"
withdraw = request("amount"
balance = balance - withdraw
if balance > withdraw then
RS("cl_balance"=balance
Response.Write("transaction successful"
else
Response.Write("transaction unsuccessful"
end if
RS.Update
============== line 30
RS.MoveNext
RS.Close
%>
<%WHILE NOT RS.EOF%>
<%Response.Write(RS("cl_balance")%>
<%RS.MoveNext
WEND
myCon.Close%>