sankar_k
11 years agoOccasional Contributor
Checking success of DB transaction
Hi There
I am trying to insert a record into Microsoft SQL Server database table using ADO objects. The sample code is as follows
Dim AConnection
Set AConnection = ADO.CreateADOConnection
AConnection.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=EASDS;UID=eas_system;PWD=EAS"
AConnection.LoginPrompt = False
AConnection.Open
AConnection.Execute_("Insert into emp('1','Sankar')
The code works properly. I want to know whether the last statement AConnection.Execute_ is successful or not. Appreciate if you some one can throw a light on this
I am trying to insert a record into Microsoft SQL Server database table using ADO objects. The sample code is as follows
Dim AConnection
Set AConnection = ADO.CreateADOConnection
AConnection.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=EASDS;UID=eas_system;PWD=EAS"
AConnection.LoginPrompt = False
AConnection.Open
AConnection.Execute_("Insert into emp('1','Sankar')
The code works properly. I want to know whether the last statement AConnection.Execute_ is successful or not. Appreciate if you some one can throw a light on this
- If it is not successful, you'll get an exception and script execution will stop. Sp you will definitely know it was not successful :)