Subject Automatic Transaction Commencement in FireBird?
Author protoiyer
Hi,

I am having some trouble with the following bit of code that talks to
both Interbase (IB) and Firebird (FB).

It works fine in IB, but fails in FB. The culprit is the pair of lines
that read:

rs.SQL = "Commit;"; rs.Execute

It looks like after the above Commit, IB some how starts the next
transaction, where as FB is not doing that, and so when you reach the
second "rs.Execute" after Commit, it bombs in Firebird, though it works
in Interbase.

Also, if I replace "rs.SQL = "Commit;"; rs.Execute" with the green
lines (cn.CommitTrans; cn.BeginTrans) it works fine.

Essentially I want it to work with "rs.SQL = "Commit;"; rs.Execute" in
FB too!

Any help would be appreciated. Thanks.

>>

Dim cn As rdoConnection
Dim rs As rdoQuery

'Objects are created and set up properly etc.

cn.BeginTrans

rs.SQL = "INSERT INTO XYZ VALUES (1, 'TEST')"
rs.Execute

' if you comment out the next two lines and replace with the two
green lines below, it works in FB!

rs.SQL = "Commit;"
rs.Execute

'cn.CommitTrans
'cn.BeginTrans

rs.SQL = "select * from XYZ WHERE FIELD1 = 1"
rs.Execute -- this line fails in FB, but works in IB
MsgBox ("Success " + CStr(Resultset.rdoColumns.Item(0).Value))

cn.CommitTrans

<<

Regards,
Suresh.


[Non-text portions of this message have been removed]