vb2003 and Sqlbase

  • Thread starter Thread starter Peter Lux
  • Start date Start date
P

Peter Lux

I'm writing a query tool using vb and Sqlbase and noticed that when I do a
'non-query' statement, it automatically commits. I'd like to have it wait
until a 'commit' is issued before the commit. I thought you had to do this
in a transaction. I changed the code to do a transaction, but now when I
issue the commit, it gives me an 'XACT_E_NOTSUPPORTED(0X8004D00F) error.
Heres the code..

If LTrim(LCase(Mid(tc1.Text, 1, 6))) = "commit" Then
MsgBox(trans.IsolationLevel.ToString)
Try
trans.Commit()
Catch ex As Exception
MsgBox(ex.Message)
End Try
ElseIf LTrim(LCase(Mid(tc1.Text, 1, 6))) = "rollback" Then
Try
trans.Rollback()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
trans = hQuest.BeginTransaction(IsolationLevel.ReadCommitted)
sCommand.Transaction = trans
MsgBox(trans.IsolationLevel.ToString)
Try
nRows = sCommand.ExecuteNonQuery()
sb.Text = nRows.ToString & " row(s) affected"
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If

I've tried various Isolation level changes and don't get anything. Any
clues??
 
If I want to issue a rollback or commit sql statement, do I executeScaler or
ExecuteNonQuery?
 
Back
Top