Python ADO + ODBC function - python

I am writing a small module to help a transfer from M$-Access to SQLite (database needs to be portable), but I'm struggling in interpreting the error message that follows from this code (and of course to get it to work).
import pyodbc
import win32com.client
def ado(db, sqlstring='select * from table', user='admin', password=''):
conn = win32com.client.Dispatch(r'ADODB.Connection')
DSN = ('PROVIDER = Microsoft.Jet.OLEDB.4.0;DATA SOURCE = ' + db + ';')
conn.Open(DSN)
rs = win32com.client.Dispatch(r'ADODB.Recordset')
rs.Open(strsql, conn, 1, 3)
data = rs.GetRows()
conn.Close()
return data
def odbc(db, sqlstring='select * from table', user= 'admin', password=''):
"""Create function for connecting to Access databases."""
odbc_conn_str = 'DRIVER={Microsoft Access Driver (*.mdb)};DBQ=%s;UID=%s;PWD=%s' % (db, user, password)
conn = pyodbc.connect(odbc_conn_str)
cur = conn.cursor()
cur.execute(strsql)
data = list(cur)
conn.close()
return data
if __name__ == '__main__': # Unit test
db = r'C:\pyodbc_access2007_sample.accdb'
sql="select * from Customer Orders" ## tables: 'Customer Orders', 'Physical Stoks','Prodplans'
data1 = ado(db,sql)
data2 = odbc(db,sql)
From the ado function I get the error:
Traceback (most recent call last):
File "C:/pyodbc_access2007_example.py", line 27, in <module>
data1 = ado(db,sql)
File "C:/pyodbc_access2007_example.py", line 7, in ado
conn.Open(DSN)
File "<COMObject ADODB.Connection>", line 3, in Open
File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 282, in _ApplyTypes_
result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, retType, argTypes) + args)
com_error: (-2147352567, 'Exception occurred.', (0, u'Microsoft JET Database Engine', u"Unrecognized database format 'C:\\pyodbc_access2007_sample.accdb'.", None, 5003049, -2147467259), None)
and from the odbc function I get the error:
Traceback (most recent call last):
File "C:/pyodbc_access2007_example.py", line 28, in <module>
data2 = odbc(db,sql)
File "C:/pyodbc_access2007_example.py", line 17, in odbc
conn = pyodbc.connect(odbc_conn_str)
Error: ('HY000', "[HY000] [Microsoft][ODBC Microsoft Access Driver] Cannot open database '(unknown)'. It may not be a database that your application recognizes, or the file may be corrupt. (-1028) (SQLDriverConnect); [01000] [Microsoft][ODBC Microsoft Access Driver]General Warning Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x18c0 Thread 0xe70 DBC 0x379fe4 Jet'. (1); [01000] [Microsoft][ODBC Microsoft Access Driver]General Warning Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x18c0 Thread 0xe70 DBC 0x379fe4 Jet'. (1); [01000] [Microsoft][ODBC Microsoft Access Driver]General Warning Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x18c0 Thread 0xe70 DBC 0x379fe4 Jet'. (1); [01000] [Microsoft][ODBC Microsoft Access Driver]General Warning Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x18c0 Thread 0xe70 DBC 0x379fe4 Jet'. (1); [HY000] [Microsoft][ODBC Microsoft Access Driver] Cannot open database '(unknown)'. It may not be a database that your application recognizes, or the file may be corrupt. (-1028)")
Any good idea's on how to read this?

Your connection string only recognizes mdb access files. There is a connection string that will do mdb and accdb files in pyodbc.

select * from Customer Orders
----------------------^
Having spaces in table names like that, does that really work in Access?
For MSSQL Server I'd quote it like in
[Customer Orders]

For accessing accdb files, you need to install AccessDatabaseEngine.
Also, be aware if you need 32 or 64 bits!

Related

Problem opening connection to SQL Server DB using pyodbc and machine learning services

I have Anaconda installed on one of our servers, and some code which successfully opens a connection to SQL (2016) on another server:
import pyodbc
conn_string = 'DRIVER={SQL Server Native Client 11.0};SERVER=wpic-smir;Trusted_Connection=yes'
conn = pyodbc.connect(conn_string)
cursor=conn.cursor()
qstring = 'select UserID from Diler_BW.Beckwith.V_Thermovals'
cursor.execute(qstring)
row=cursor.fetchone()
print row[0]
del cursor
del conn
Now, on the same server as Anaconda, we have SQL Server (2017) installed, and Machine Learning Service for Python is also installed. I'm trying to do run essentially the same code above, but from within SQL:
exec sp_execute_external_script
#LANGUAGE = N'Python',
#script = N'
import pyodbc
conn_string = ''DRIVER={SQL Server Native Client 11.0};SERVER=wpic-smir;Trusted_Connection=yes''
conn = pyodbc.connect(conn_string)
cursor=conn.cursor()
qstring = ''select UserID from Diler_BW.Beckwith.V_Thermovals''
cursor.execute(qstring)
row=cursor.fetchone()
print row[0]
del cursor
del conn
'
The code runs successfully from standalone Anaconda, but, from a SQL query connected to the 2017 server, it does not:
Msg 39004, Level 16, State 20, Line 0
A 'Python' script error occurred during execution of 'sp_execute_external_script' with HRESULT 0x80004004.
Msg 39019, Level 16, State 2, Line 0
An external script error occurred:
Error in execution. Check the output for more information.
Traceback (most recent call last):
File "<string>", line 5, in <module>
File "C:\ProgramData\MSSQLSERVER\Temp-PY\Appcontainer1\41EF254D-1B14-4D9D-99AF-8AD356A84BDC\sqlindb_0.py", line 39, in transform
conn = pyodbc.connect(conn_string)
pyodbc.OperationalError: ('08001', '[08001] [Microsoft][SQL Server Native Client 11.0]Named Pipes Provider: Could not open a connection to SQL Server [65]. (65) (SQLDriverConnect); [08001] [Microsoft][SQL Server Native Client 11.0]Login timeout expired (0); [08001] [Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. (65)')
Msg 39019, Level 16, State 2, Line 0
An external script error occurred:
SqlSatelliteCall error: Error in execution. Check the output for more information.
STDOUT message(s) from external script:
Express Edition will continue to be enforced.
SqlSatelliteCall function failed. Please see the console output for more information.
Traceback (most recent call last):
File "C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\revoscalepy\computecontext\RxInSqlServer.py", line 605, in rx_sql_satellite_call
rx_native_call("SqlSatelliteCall", params)
File "C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\revoscalepy\RxSerializable.py", line 375, in rx_native_call
ret = px_call(functionname, params)
RuntimeError: revoscalepy function failed.
The account I'm using for development is in the sysadmin role on both servers. We use Windows authentication only on both servers. I assume that something significant is different about the instance of python that SQL/MLS uses than the standalone installation.
Thank you.

Cannot create database with SQLAlchemy with SQL Server

Please note that I have been attempting to create a new database using SQLAlchemy, but have gotten many errors where I am attempting to work with laravel and vagrant. Thankfully I have been able to create a new database using pyodbc, but ultimately I would like to do everything through SQLAlchemy.
This is the code that works for creating a new database at this point using pyodbc:
for tagList in myTagList:
conn = pyodbc.connect("driver={SQL Server Native Client 11.0};server=localhost,2433; database=master; UID=myUser;PWD=myUser2", autocommit=True)
conn.execute('CREATE DATABASE ' + tagList["job"].jobNumber)
How would I change this to work with SQLAlchemy? Presently I have looked at many links like How to create a new database using SQLAlchemy? and sqlalchemy,creating an sqlite database if it doesn't exist but and https://sqlalchemy-utils.readthedocs.io/en/latest/database_helpers.html it appears to work with postgresql but not SQL Server:
Add support for creating databases (see How to create a new database using SQLAlchemy?):
Projects>pip install sqlalchemy-utils
pip install sqlalchemy-utils
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won`t be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting sqlalchemy-utils
Downloading https://files.pythonhosted.org/packages/bf/7e/3211ad9b3983b216d1b1863fd7734f80bacd1a62a5de8ff6844fb5ed1498/SQLAlchemy-Utils-0.35.0.tar.gz (129kB)
Requirement already satisfied: six in c:\users\myUser\appdata\roaming\python\python27\site-packages (from sqlalchemy-utils) (1.13.0)
Requirement already satisfied: SQLAlchemy>=1.0 in c:\python27\lib\site-packages (from sqlalchemy-utils) (1.3.11)
Installing collected packages: sqlalchemy-utils
Running setup.py install for sqlalchemy-utils: started
Running setup.py install for sqlalchemy-utils: finished with status 'done'
Successfully installed sqlalchemy-utils-0.35.0
--------------------------------------------------------------------------------
#Save historical data into new MyDB000N database
for tagList in myTagList:
fsDatabaseEngine = create_engine('mssql+pyodbc://myUser:myUser2#localhost:2433/' + tagList["job"].jobNumber + '?driver=SQL+Server+Native+Client+11.0?trusted_connection=yes')
if not database_exists(fsDatabaseEngine.url):
create_database(fsDatabaseEngine.url)
print(database_exists(fsDatabaseEngine.url))
-----
On this line if not database_exists(fsDatabaseEngine.url): receiving:
self.__connect(first_connect_check=True)
File "C:\Python27\lib\site-packages\sqlalchemy\pool\base.py", line 639, in __connect
connection = pool._invoke_creator(self)
File "C:\Python27\lib\site-packages\sqlalchemy\engine\strategies.py", line 114, in connect
return dialect.connect(*cargs, **cparams)
File "C:\Python27\lib\site-packages\sqlalchemy\engine\default.py", line 482, in connect
return self.dbapi.connect(*cargs, **cparams)
sqlalchemy.exc.InterfaceError: (pyodbc.InterfaceError) ('28000', u'[28000] [Microsoft][SQL Server Native Client 11.0][SQL Server]Login failed for user \'myUser\'. (18456) (SQLDriverConnect); [28000] [Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot open database "MyDB00001" requested by the login. The login failed. (4060); [28000] [Microsoft][SQL Server Native Client 11.0][SQL Server]Login failed for user \'myUser\'. (18456); [28000] [Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot open database "MyDB00001" requested by the login. The login failed. (4060)')
(Background on this error at: http://sqlalche.me/e/rvf5)
-----
C:\Python27\lib\site-packages\sqlalchemy\connectors\pyodbc.py:79: SAWarning: No driver name specified; this is expected by PyODBC when using DSN-less connections
"No driver name specified; "
-----
#Save historical data into new MyDB000N database
for tagList in myTagList:
# fsDatabaseEngine = create_engine('mssql://mssql#localhost:2433/' + tagList["job"].jobNumber + '?driver=SQL+Server+Native+Client+11.0?trusted_connection=yes')
# if not database_exists(fsDatabaseEngine.url):
create_database('mssql://mssql#localhost:2433/' + tagList["job"].jobNumber)
#print(database_exists(fsDatabaseEngine.url))
File "C:\Python27\lib\site-packages\sqlalchemy\engine\default.py", line 482, in connect
return self.dbapi.connect(*cargs, **cparams)
sqlalchemy.exc.InterfaceError: (pyodbc.InterfaceError) ('IM002', u'[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')
(Background on this error at: http://sqlalche.me/e/rvf5)
PS Projects>
-----
#Save historical data into new MyDB000N database
for tagList in myTagList:
# fsDatabaseEngine = create_engine('mssql://mssql#localhost:2433/' + tagList["job"].jobNumber + '?driver=SQL+Server+Native+Client+11.0?trusted_connection=yes')
# if not database_exists(fsDatabaseEngine.url):
create_database('mssql://myUser:myUser2#localhost:2433/' + tagList["job"].jobNumber+ '?driver=SQL+Server+Native+Client+11.0?trusted_connection=yes')
#print(database_exists(fsDatabaseEngine.url))
File "C:\Python27\lib\site-packages\sqlalchemy\engine\base.py", line 1246, in _execute_context
cursor, statement, parameters, context
File "C:\Python27\lib\site-packages\sqlalchemy\engine\default.py", line 581, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (pyodbc.ProgrammingError) ('42000', u'[42000] [Microsoft][SQL Server Native Client 11.0][SQL Server]CREATE DATABASE statement not allowed within multi-statement transaction. (226) (SQLExecDirectW)')
[SQL: CREATE DATABASE [MyDB00001]]
(Background on this error at: http://sqlalche.me/e/f405)
PS Projects>
-----
#Save historical data into new MyDB000N database
for tagList in myTagList:
with create_engine(
'mssql://mssql',
isolation_level="AUTOCOMMIT"
).connect() as connection:
connection.execute('CREATE DATABASE ' + tagList["job"].jobNumber)
# if not database_exists(fsDatabaseEngine.url):
#create_database('mssql://myUser:myUser2#localhost:2433/' + tagList["job"].jobNumber)
#print(database_exists(fsDatabaseEngine.url))
File "C:\Python27\lib\site-packages\sqlalchemy\engine\default.py", line 482, in connect
return self.dbapi.connect(*cargs, **cparams)
sqlalchemy.exc.InterfaceError: (pyodbc.InterfaceError) ('IM002', u'[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')
(Background on this error at: http://sqlalche.me/e/rvf5)
PS Projects>
-----
#Save historical data into new MyDB000N database
for tagList in myTagList:
session.execute('CREATE DATABASE ' + tagList["job"].jobNumber)
File "C:\Python27\lib\site-packages\sqlalchemy\engine\default.py", line 581, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (pyodbc.ProgrammingError) ('42000', u'[42000] [Microsoft][SQL Server Native Client 11.0][SQL Server]CREATE DATABASE statement not allowed within multi-statement transaction. (226) (SQLExecDirectW)')
[SQL: CREATE DATABASE MyDB00001]
(Background on this error at: http://sqlalche.me/e/f405)
PS Projects>
-----
#Save historical data into new MyDB000N database
for tagList in myTagList:
conn = pyodbc.connect("driver={SQL Server};server=ubuntu-bionic; database=master; trusted_connection=true",
autocommit=True)
Exception has occurred: OperationalError
('08001', u'[08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. (17) (SQLDriverConnect); [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()). (53)')
File "Projects\interesting_data.py", line 81, in <module>
autocommit=True)
-----
#Save historical data into new MyDB000N database
for tagList in myTagList:
conn = pyodbc.connect("driver={SQL Server Native Client 10.0};server=localhost,2433; database=master; trusted_connection=true", autocommit=True)
Exception has occurred: InterfaceError
('IM002', u'[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')
File "Projects\interesting_data.py", line 80, in <module>
conn = pyodbc.connect("driver={SQL Server Native Client 10.0};server=localhost,2433; database=master; trusted_connection=true", autocommit=True)
-----
#Save historical data into new MyDB000N database
for tagList in myTagList:
conn = pyodbc.connect("driver={SQL Server Native Client 11.0};server=localhost,2433; database=master; trusted_connection=true", autocommit=True)
Exception has occurred: OperationalError
('08001', u"[08001] [Microsoft][SQL Server Native Client 11.0]Invalid value specified for connection string attribute 'trusted_connection' (0) (SQLDriverConnect)")
File "Projects\interesting_data.py", line 80, in <module>
conn = pyodbc.connect("driver={SQL Server Native Client 11.0};server=localhost,2433; database=master; trusted_connection=true", autocommit=True)
-----
#Save historical data into new MyDB000N database
for tagList in myTagList:
conn = pyodbc.connect("driver={SQL Server Native Client 11.0};server=localhost,2433; database=master; trusted_connection=yes", autocommit=True)
Exception has occurred: Error
('HY000', u'[HY000] [Microsoft][SQL Server Native Client 11.0]SQL Server Network Interfaces: No credentials are available in the security package\r\n (-2146893042) (SQLDriverConnect); [HY000] [Microsoft][SQL Server Native Client 11.0]Cannot generate SSPI context (-2146893042); [HY000] [Microsoft][SQL Server Native Client 11.0]SQL Server Network Interfaces: No credentials are available in the security package\r\n (-2146893042); [HY000] [Microsoft][SQL Server Native Client 11.0]Cannot generate SSPI context (-2146893042)')
File "Projects\interesting_data.py", line 80, in <module>
conn = pyodbc.connect("driver={SQL Server Native Client 11.0};server=localhost,2433; database=master; trusted_connection=yes", autocommit=True)
import urllib
#Save historical data into new MyDB000N database
for tagList in rdTagList:
# if not database_exists(fsDatabaseEngine.url):
params = urllib.parse.quote_plus("driver={SQL Server Native Client 11.0};server=localhost,2433; database=master; UID=phpUser;PWD=phpUser2")
tagListEngine = sqlalchemy.create_engine("mssql+pyodbc:///?odbc_connect=%s" % params)
tagListEngine.connect()
Which gives:
Exception has occurred: AttributeError
'module' object has no attribute 'parse'
File "C:\Projects\interesting_data.py", line 82, in <module>
params = urllib.parse.quote_plus("driver={SQL Server Native Client 11.0};server=localhost,2433; database=master; UID=myUser;PWD=myUser2")
What do you suggest? TIA.
UPDATE:
Not sure how I missed it before but ultimately based on #snakecharmerb's suggestion it is now working without requiring urllib:
#Save historical data into new MyDB000N database
for tagList in rdTagList:
fsDatabaseEngine = create_engine('mssql+pyodbc://myUser:myUser2#localhost:2433/' + tagList["job"].jobNumber + '?driver=SQL+Server+Native+Client+11.0?trusted_connection=yes')
if not database_exists(fsDatabaseEngine.url):
create_database(fsDatabaseEngine.url)
print(database_exists(fsDatabaseEngine.url))
Thank you!
UPDATE 2:
To zero in on the solution, in my research I had found explanations using postgres://postgres ..., but ultimately in my case I needed to change mssql://myUser to mssql+pyodbc://myUser...
Based on #shakecharmerb's comment, this is the solution:
#Save historical data into new MyDB000N database
for tagList in rdTagList:
fsDatabaseEngine = create_engine('mssql+pyodbc://myUser:myUser2#localhost:2433/' + tagList["job"].jobNumber + '?driver=SQL+Server+Native+Client+11.0?trusted_connection=yes')
if not database_exists(fsDatabaseEngine.url):
create_database(fsDatabaseEngine.url)
print(database_exists(fsDatabaseEngine.url))

Can no longer access files from shared folder or SQL server using Python after updating password on Windows 10?

I have a script that I run in Jupyter Notebook every week that requires connecting to MSSQL and accessing files from a shared folder. I have never had problems doing this before, however, I recently had to update my Windows password. Since then, I've been having these issues.
When trying to connect to the MSSQL server I get the error:
Error: ('HY000', '[HY000] [Microsoft][ODBC Driver 17 for SQL Server]SQL
Server Network Interfaces: The logon attempt failed\r\n (-2146893044)
(SQLDriverConnect); [HY000] [Microsoft][ODBC Driver 17 for SQL Server]Cannot
generate SSPI context (-2146893044); [HY000] [Microsoft][ODBC Driver 17 for
SQL Server]SQL Server Network Interfaces: The logon attempt failed\r\n
(-2146893044); [HY000] [Microsoft][ODBC Driver 17 for SQL Server]Cannot
generate SSPI context (-2146893044)')
When trying to access a file on the shared folder I get:
com_error: (-2147352567, 'Exception occurred.', (0, 'Microsoft Excel',
"Sorry, we couldn't find {file} Is it possible it was moved, renamed or
deleted?", 'xlmain11.chm', 0, -2146827284), None)
or
OSError: [Errno 22] Invalid argument: {file}
However, if I manually navigate to these folders/files I don't have any issues and if I sign into the MSSQL server using Windows Authentication I don't have any issues either. Any suggestions on how to solve this?
EDIT:
This is the command I use to connect:
con = pyodbc.connect('Trusted_Connection=yes', driver = '{ODBC Driver 17 for SQL Server}',server = '{server}', database = '{database}')
cursor = con.cursor()
and I just use
pd.read_excel({file_path})
to get the file.

Error finding msaccess driver on windows parallel on a mac

I'm using pyodbc to acces a MSaccess database using python 2.7. I'm running windows 7 on parallels v10 on osx10.9. I'm using the following code to test it:
DBfile = 'c:\\dir\\testdb.db'
conn = pyodbc.connect('DRIVER={Microsoft Access Driver (*.mdb)};DBQ='+DBfile)
and it cannot seem to locate the MSAccess driver, resulting in the following error:
> Traceback (most recent call last): File "C:/Projects/DBtest.py",
> line 6, in <module>
> conn = pyodbc.connect('DRIVER={Microsoft Access Driver (*.mdb)};DBQ='+DBfile) Error: ('HY024', "[HY024] [Microsoft][ODBC
> Microsoft Access Driver] '(unknown)' is not a valid path. Make sure
> that the path name is spelled correctly and that you are connected to
> the server on which the file resides. (-1023) (SQLDriverConnect);
> [01000] [Microsoft][ODBC Microsoft Access Driver]General Warning
> Unable to open registry key 'Temporary (volatile) Jet DSN for process
> 0x590 Thread 0xa50 DBC 0x2c9389c Jet'. (1); [01000] [Microsoft][ODBC
> Microsoft Access Driver]General Warning Unable to open registry key
> 'Temporary (volatile) Jet DSN for process 0x590 Thread 0xa50 DBC
> 0x2c9389c Jet'. (1); [HY024] [Microsoft][ODBC Microsoft Access Driver]
> '(unknown)' is not a valid path. Make sure that the path name is
> spelled correctly and that you are connected to the server on which
> the file resides. (-1023)")
I can't see anything else on SO that covers this issue but I'm new to ODBC and fairly new to SO so apologies if I've overlooked anything. Does anyone have any ideas?
Cheers

Error in opening an Access database in python

I am a new to python programming and i want to write a python program to read and write data to and from the database.
The connection code is as follows:
DNS='catalog'
DRV = '{Microsoft Access Driver (*.mdb)}'
conn = pyodbc.connect('DRIVER=%s;DSN=%s;' % (DRV,DNS))
catalog is the DSN name.
I am am getting the following error:
Traceback (most recent call last):
File "C:\Python27\exampes\xxx.py", line 8, in <module>
conn = pyodbc.connect('DRIVER=%s;DSN=%s;' % (DRV,DNS))
Error: ('01000', "[01000] [Microsoft][ODBC Microsoft Access Driver]General Warning Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x12b4 Thread 0x1544 DBC 0x567ea4 Jet'. (1) (SQLDriverConnect);
[01000] [Microsoft][ODBC Microsoft Access Driver]General Warning Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x12b4 Thread 0x1544 DBC 0x567ea4 Jet'. (1)"
Can anyone please help me..?
The account under which you are running is not an administrator. It needs registry access as per the message (also described here)
Registry access is needed to find the ODBC driver for MS Access.
try to uncheck Attributes: Read-only box in file properties.

Categories