@rnd_d , acting according to the principle of simplification, I wrote a program

import pyodbc #import kinterbasdb import firebirdsql import os import json,sqlite3,sql s1=''' create table CLIENTS ( ID INTEGER NOT NULL, COMPANY VARCHAR(50), "LAST NAME" VARCHAR(50), "FIRST NAME" VARCHAR(50), "E-MAIL ADDRESS" VARCHAR(50), "JOB TITLE" VARCHAR(50), "BUSINESS PHONE" VARCHAR(25), "HOME PHONE" VARCHAR(25), "MOBILE PHONE" VARCHAR(25), "FAX NUMBER" VARCHAR(25), ADDRESS BLOB SUB_TYPE 1, CITY VARCHAR(50), "STATE/PROVINCE" VARCHAR(50), "ZIP/POSTAL CODE" VARCHAR(15), "COUNTRY/REGION" VARCHAR(50), "WEB-SITE" VARCHAR(25), NOTES BLOB SUB_TYPE 1, INCLUDING BLOB, CONSTRAINT PK_CLIENTS_ID PRIMARY KEY(ID) ); ''' s2='''create ascending index IDX_CLIENTS_CITY on CLIENTS (CITY);''' #os.remove('D:/ThirdTask/test1.fdb') conn=firebirdsql.create_database(dsn='localhost/3050:/test.fdb', user='sysdba', password='masterkey') cur=conn.cursor() cur.execute(s1) cur.execute(s2) conn.commit() conn.close() 

where s1 it performed, and s2 failed to execute in the previous program. As a result, it did not create the file test1.fdb in the current folder, i.e. it could not even create a database.

  • What if? cur.execute (s1) conn.commit () cur.execute (s2) conn.commit () - rnd_d
  • @rnd_d exactly at 2 commits, an error occurs, indicated at hashcode.ru/questions/151832/…, see the answer to stackoverflow.com/questions/12781696/… . After one commit to all lines, this error really disappeared, but for some reason a base is not created. - ivan89
  • And if you comment out the cur.execute line (s2), the base is created? - rnd_d
  • one
    @rnd_d, is not created. - ivan89
  • @rnd_d, I found that using the connection string conn = firebirdsql.create_database (host = 'localhost', database = 'D: /boreas.fdb', user = 'sysdba', password = 'masterkey') the database is being created. And in the current D: \ ThirdTask folder I saw the read-only attribute that I tried to remove, but did not work (when I opened the properties, the box was filled in again) - ivan89

0