When you get the Error 10001 saying "Failed to find the transaction 'sqlca' in the current session. Please check whether you have connected the database corresponding to the transaction." please refer to the following for solutions.
Symptom: The error 10001 “Failed to find the transaction 'sqlca' in the current session. Please check whether you have connected the database corresponding to the transaction.” pops up when you try to disconnect it after a transaction connection failure.
Code example:
SQLCA.DBMS = "MSS"
SQLCA.LogPass = sle_2.text
SQLCA.LogId = sle_1.text
SQLCA.AutoCommit = False
SQLCA.DBParm = "”
Connect using sqlca;
IF SQLCA.SqlCode < 0 THEN //After you enter the password and connect using sqlca, you need to decide whether the return value of SQLCA.SqlCode is correct or not. If not, you need to disconnect it and then connect it again.
Messagebox(‘Failed’, 'Failed To Logon in System.')
Disconnect using sqlca; ELSE
open(w_mdi)
END IFSolution: The error 10001 “Failed to find the transaction 'sqlca' in the current session. Please check whether you have connected the database corresponding to the transaction.” pops up when you try to disconnect it after a transaction connection failure.