Home > database >  Pb exe problem
Pb exe problem

Time:09-25

Specific circumstances, in a pb9.0 development environment using the sqlca SQL database connection, SQLCB connection access database, in the development environment to access library table write data no problem, make exe can even after aceess database, is unable to write data,
The code is: S
QLCB=create TRANSACTION
SQLCB. DBMS="ODBC"
SQLCB. The AutoCommit=False
SQLCB. DBParm="ConnectString='DSN=TestLocal; UID=' '; The PWD="'
"
Connect using SQLCB;

If SQLCB. Sqlcode<0 then
Messagebox (" database error ", "unable to connect to a local database! TestLocal "+ SQLCB SQLErrtext)
End the if
Li_rowcount=8;
Insert into dztable_info (table_num) values (: li_rowcount) using SQLCB;
commit;

Insert the data no problem in the development environment, to exe is washed-up, exe folder DLL and other documents in need, really don't understand please give advice or comments?

CodePudding user response:

Commit the using SQLCB;

CodePudding user response:

Upstairs, positive solutions should be commint using SQLCB;

Also, the insert into statement, should be timely judge SQLCB. Sqlcode return values, in order to judge the success of

Insert into dztable_info (table_num) values (: li_rowcount) using SQLCB;
If SQLCB. Sqlcode<> 0 then
MessageBox (" prompt ", "new data failed:" + SQLCB. Sqlerrtext)
The rollback using SQLCB;
The else
Commit the using SQLCB;
end if

CodePudding user response:

Likely to readonly ODBC configuration page

CodePudding user response:

Because you didn't add connection dbparm CommitOnDisconnect='No',
You finish operation and close the development environment, automatically submitted,

Have you finish the SQL execution to commit using transaction;
Pay attention to the transaction must be correct

CodePudding user response:

reference 1st floor wag_enu response:
commit using SQLCB;



Commit the default is the SQLCA, to use another connection need to specify its name
  • Related