Home > database >  Help: custom transaction object
Help: custom transaction object

Time:09-26

Excuse me, can use in your application a custom transaction object to connect to the database?

For example like this, is that ok?

The application of the open () event:
The Transaction sqluser
Sqluser=create transaction

Sqluser. DBMS="ODBC"
Sqluser. The AutoCommit=False
Sqluser. DBParm="Connectstring='DSN=mytest"

CONNECT USING sqluser;

If sqluser. SQLCode & lt; 0 then
Messagebox (" connection ", "the reason for failure:" + sqluser. SQLErrText, StopSign!)
The HALT CLOSE//terminate the system run
End the if

Application of the close () event
DISCONNECT the USING sqluser;

If sqluser. SQLCode & lt; 0 then
Messagebox (" disconnect "failure," the reason for failure: "+ sqluser. SQLErrText, StopSign!)
End the if

Destroy sqluser

CodePudding user response:

Of course the

CodePudding user response:

Thank you very much upstairs, but such complains, could help see what reason be?

I declare the global variables: transaction sqluser, create after save, using the create hint say:
Illegal data type: sqluser

CodePudding user response:

refer to the second floor yifaner22 response:
thank you very much for the upstairs, but such complains, could help to see what reason be?

I declare the global variables: transaction sqluser, create after save, using the create hint say:
Illegal data type: sqluser


Determine the transaction sqluser written in declare Variables in?

CodePudding user response:

Wag_enu, was indeed a statement global variables declared in the transaction object variables

CodePudding user response:

The Transaction sqluser//this sentence in a statement

Sqluser=create transaction where the use of writing or writing in application

Don't write all the global declarations

CodePudding user response:

Thank you yyoinge
Create a statement I is written in the application, not with statement.
  • Related