Dim strConnString As String
strConnString = "Provider=SQLOLEDB;Server=localhost;Database=test;Uid=sa; Pwd=12345678;"
Dim myconn As New OleDb.OleDbConnection(strConnString)
myconn.Open()
Dim cSQL As String
Dim myTrans As OleDb.OleDbTransaction
Dim mycomm As OleDb.OleDbCommand
Try
myTrans = myconn.BeginTransaction(IsolationLevel.ReadCommitted)
cSQL = "insert into test (firstname,lastname) values ("Peter","Jackson")"
mycomm = New OleDb.OleDbCommand(cSQL, myconn, myTrans)
mycomm.CommandType = CommandType.Text
mycomm.ExecuteNonQuery()
myTrans.Commit()
Catch ex As Exception
Response.Write(ex.Message)
myTrans.Rollback()
End Try