Thread: Verify Execute
Hello
Is there a way to find out if the EXECUTE of a UPDATE, INSERT has been completed successfully?
Here is an example of what I do:
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Form_Store_PSQL"
conn.Open "Form_Store_PSQL"
Set oRs = Server.CreateObject("ADODB.Recordset" )
strSQL = "INSERT INTO TABLE_TEMP (ID) VALUES ('1')"
conn.Execute strSQL
Thank you
Shavonne Wijesinghe
On Tuesday 24 June 2008 17:18:22 Shavonne Marietta Wijesinghe wrote: > Hello > > Is there a way to find out if the EXECUTE of a UPDATE, INSERT has been completed successfully? > > Here is an example of what I do: > > Set conn = Server.CreateObject("ADODB.Connection") > conn.Open "Form_Store_PSQL" > > Set oRs = Server.CreateObject("ADODB.Recordset" ) > strSQL = "INSERT INTO TABLE_TEMP (ID) VALUES ('1')" > conn.Execute strSQL If no Exception is thrown, the execution of the query was successfull. Note that usually INSERT, UPDATE and DELETE return an integer > 0, indicating affected rows, but not always. There mightbe 0 affected rows, which is not nessesarily an error. -- Andreas Joseph Krogh <andreak@officenet.no> Senior Software Developer / Manager ------------------------+---------------------------------------------+ OfficeNet AS | The most difficult thing in the world is to | Karenslyst Allé 11 | know how to do a thing and to watch | PO. Box 529 Skøyen | somebody else doing it wrong, without | 0214 Oslo | comment. | NORWAY | | Tlf: +47 24 15 38 90 | | Fax: +47 24 15 38 91 | | Mobile: +47 909 56 963 | | ------------------------+---------------------------------------------+