[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.4

commit and rollback

Asked by talktome_prashanth in Active Server Pages (ASP)

Tags: commit, rollback

Hello  I got this below asp code which creats new record and i need commit and rollback support in case of error while updating.
Server is windows 2000 and IIS and access database 2000 format.
Please some body help me.
Thank you,
Prashanth

<%
On Error Resume Next

'======= Retrieve the data sent with the URL
On Error Resume Next
Dim Problem
    Problem = "None"
     
Dim strLast
strLast = Request.Form("lastname")
          if strLast = "" then strLast = "N/A "
Dim strFirst
strFirst = Request.Form("firstname")
          if strFirst = "" then strFirst = "N/A "
Dim strGender
strGender = Request.Form("gender")
          if strGender = "" then strGender = "N/A "
Dim strAddress
strAddress = Request.Form("address")
          if strAddress = "" then strAddress = "N/A "
Dim strCity
strCity = Request.Form("city")
          if strCity = "" then strCity = "N/A "
Dim strState
strState = Request.Form("state")
          if strState = "" then strState = "N/A "
Dim strZip
strZip = Request.Form("zip")
          if strZip = "" then strZip = "N/A "

%>    




------------------------
<%     '======= Open the database connection


   Dim sql
   Set cnn1 = Server.CreateObject("ADODB.Connection")
      If Err Then Problem = "True"
   openStr = "driver={Microsoft Access Driver (*.mdb)};" &_
   "dbq=" & Server.MapPath("database/data.mdb")
      If Err Then Problem = "True"
   cnn1.Open openStr, "",""
      If Err Then Problem = "True"

   sql = "SELECT * FROM Contestants;"
   
   Set rs = Server.CreateObject("ADODB.Recordset")
   rs.Open sql, cnn1, 1, 3
      If Err Then Problem = "Can't Open"
       
'======= Add the New record
      rs.AddNew
      rs("category") = strCategory
      rs("lastname") = strLast
      rs("firstname") = strFirst
      rs("address") = strAddress
      rs("city") = strCity
      rs("state") = strState
      rs("zip") = strZip
        rs("regdate") = Date()
        rs("regtime") = Time()
       rs.Update
      If Err Then Problem = Problem & " Can't Update"
     
     
     If (Problem <> "None") Then
        Response.Write "ERROR!<br>"
        Response.Write "An unexpected error has occured (" & Err & " " & Problem & ") while processing your data.<br>"
        Response.Write "Please DO NOT SUBMIT AGAIN and CONTACT US by selecting contact from above menu<br>"
        Response.Write "Please send us the name, email of the person registering while contacting us<br>"


         Else
      //Print congratulations screen.
 //Print congratulations screen.
 //Print congratulations screen.

    End If
   
'======= Close the recordset
   rs.Close
   set rs = Nothing
   
'=======Close the database connection
   cnn1.Close
   Set cnn1 = Nothing
   
%>
[+][-]03/22/05 03:05 PM, ID: 13606732Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Active Server Pages (ASP)
Tags: commit, rollback
Sign Up Now!
Solution Provided By: acperkins
Participating Experts: 3
Solution Grade: A
 
[+][-]03/22/05 04:34 AM, ID: 13600224Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/22/05 06:52 AM, ID: 13601652Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/22/05 02:41 PM, ID: 13606514Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/22/05 02:48 PM, ID: 13606588Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/22/05 03:09 PM, ID: 13606770Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92