0

Below is an extract from my code..

1) insert code works fine, then..
2) retrieves inserted record ID
3) then it SHOULD update the status of the performance with "booked"

But it doesnt seem to update..

any ideas?

<%

sql="INSERT INTO bookings (performanceID, customerID, bookingDate)"
sql=sql & " VALUES "
sql=sql & "('" & Request.Form("performanceID") & "',"
sql=sql & "'" & Request.Form("customerID") & "',"
sql=sql & "'" & Request.Form("bookingDate") & "')"

'on error resume next
conn.Execute sql,recaffected 

'debug the sql statement
response.write sql

'create a new recordset to hold the new data, as we need to run a seperate query to find the bookingID

set rs2 = Server.CreateObject("ADODB.recordset")
sql2 = "SELECT @@Identity"
set rs2 = conn.execute(sql2)
bookingID = "Your Booking Number is: " & rs2(0)
response.write rs2(0)

sql3=sql3 = "UPDATE performances SET Status=booked WHERE performanceID='" & performanceID &"'"
'on error resume next
conn.Execute sql3,recaffected 

%>

Hope you can help me with my syntax..

Edited by centurion 5: n/a

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by padtes
0

Are you sure you want
sql3=sql3 = "UPDATE performances SET Status=booked WHERE performanceID='" & performanceID &"'"
OR
sql3= "UPDATE performances SET Status=booked WHERE performanceID='" & performanceID &"'"

Can you check and revert if that fixed it for you?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.