on mssql tool the database is created, with visual Cobol not, i become mssql-error-code -102 or -226
What is wrong?
Please see the Notepad document in attachment
to create tables is not the Problem! create DATABASE
I believe the 226 error is caused by the fact that you are trying to execute a CREATE DATABASE statement in transaction mode, when SQL Server does not allow such statements (CREATE DATABASE, ALTER DATABASE) to be executed in a program that uses SQL transactions.
By default, Visual COBOL uses transaction mode with OpenESQL. To instead have this statement committed as soon as it is executed (momentarily turn off transaction mode), you can use:
EXEC SQL SET AUTOCOMMIT ON END-EXEC
just before the CREATE DATABASE statement, and then use:
EXEC SQL SET AUTOCOMMIT OFF END-EXEC
just after the CREATE DATABASE to resume transaction support in your COBOL program.
(note, fixed a couple of typo's above...)