I am trying to create a web app that handles account data and prints said data to account statements and age analysis.
The data will need to be fetched from an existing Sage Evolution database and printed to a web page through Django.
I have had a look at the Django documentation, however, the inspectdb
function it gives does not give too much information on how to fetch data through a database IP address.
Does anyone have a code example/tutorial on how to fetch this data through an IP address, almost with the same procedure as the below .BAT
code
import pymssql
user = '[User ]'
password = '[Password]'
server = '[IP]'
#username: [Username]_dev_ro
#password: [Password]
#database name: DB_Name
databaseName = 'DB_Name'
conn = pymssql.connect(server, user, password, databaseName)
cursor = conn.cursor(as_dict=True)
cursor.execute('SELECT top 10 * FROM [DB_Name].[dbo].[_etblGLAccountTypes]')
for row in cursor:
print(row)
conn.close()