|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Using Transaction Object in ASP
Hi, I rewrore some of my code to include a transaction routine (I'm using JScript not VBScript) and got an error at:
if (connStudentInsert.Errors.Count > 0) { saying connStudentInsert.Errors.Count is null or not an object. earlier in the program I defined as follows: var connStudentInsert = MM_connCharms_STRINGSQL; which conects and opens successfully. Here is the complete bit of code with the transaction stuff: connStudentInsert.BeginTrans; cmdInsert.CommandText = MM_editQuery; cmdInsert.Execute(); cmdInsert.CommandText = cmdParents; cmdInsert.Execute(); cmdInsert.CommandText = cmdStudetail; cmdInsert.Execute(); if (connStudentInsert.Errors.Count > 0) { if (connStudentInsert.Errors.Item[0].Number!= 0){ connStudentInsert.RollbackTrans; Response.Write("Error Inserting Record: " + connStudentInsert.Errors.Item[0].Description); } } cmdInsert.ActiveConnection.Close(); cmdInsert = null; The three inserts work without a problem. Most times. Which is why I want to try the transactions to see why two are failing sometimes.Thanks. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Using Transaction Object in ASP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|