ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 4th, 2003, 11:40 AM
txbakers txbakers is offline
webgeek
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: Dallas, TX, USA
Posts: 120 txbakers User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 17 sec
Reputation Power: 6
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Using Transaction Object in ASP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway