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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help on editing a record in a database

Status
Not open for further replies.

MMMMMMe

Programmer
Dec 3, 2002
1
US
I get an error when I run this ASP script which says that edit is not supported. I believe that actually is supported, but is there anything else that could be wrong, or some other error in the code. I am sure that the database connection is being made, and that the database can be read and written. The code is:

<%
Const adOpenKeyset = 1
Const adLockOptimistic = 3

dim dbConnection, rs, SQL

set dbConnection = Server.CreateObject(&quot;ADODB.Connection&quot;)

dbConnection.Open &quot;CPS322&quot;

set rs = Server.CreateObject( &quot;ADODB.RecordSet&quot; )
rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic
rs.ActiveConnection = dbConnection
if request( &quot;Action&quot; ) = &quot;UpdateListcourses&quot; then
SQL = &quot;SELECT * FROM RegistrationOfferings WHERE CrsNum='&quot; & request(&quot;CrsNum&quot;) & &quot;' AND Dept='&quot; & request(&quot;Dept&quot;) & &quot;' AND Year='&quot; & request(&quot;year&quot;) & &quot;' AND Section='&quot; & request(&quot;Section&quot;) & &quot;' AND Term='&quot; & request(&quot;Term&quot;) & &quot;' AND StuNum='&quot; & request(&quot;StuNum&quot;) & &quot;'&quot;
rs.open SQL
rs.edit
rs(&quot;CourseEval&quot;) = true
rs.update
rs.close

SQL = &quot;SELECT * from evaluations&quot;
rs.open SQL
rs.addNew
rs(&quot;Year&quot;) = request(&quot;Year&quot;)
rs(&quot;Dept&quot;) = request(&quot;Dept&quot;)
rs(&quot;CrsNum&quot;) = request(&quot;CrsNum&quot;)
rs(&quot;Section&quot;) = request(&quot;Section&quot;)
rs(&quot;CrsOverall&quot;) = request(&quot;CrsOverall&quot;)
rs(&quot;CrsOverallComments&quot;) = request(&quot;CrsOverallComments&quot;)
rs(&quot;ProfOverall&quot;) = request(&quot;ProfOverall&quot;)
rs(&quot;ProfOverallComments&quot;) = request(&quot;ProfOverallComments&quot;)
rs.update
rs.close
end if
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top