notebookVB

This commit is contained in:
2025-09-28 14:42:35 +02:00
parent 7eec4caf82
commit b8b466b889
2 changed files with 14 additions and 6 deletions

4
05 testik.py Normal file
View File

@@ -0,0 +1,4 @@
import socket
computer_name = socket.gethostname()
print(computer_name)

View File

@@ -13,13 +13,8 @@ import pymysql
from pymysql.cursors import DictCursor
import fdb
MEDICUS_CFG = dict(
dsn=r"192.168.1.4:z:\medicus 3\data\medicus.fdb",
user="SYSDBA",
password="masterkey",
charset="win1250",
)
import socket
def get_medicus_connection():
"""
Attempt to create a Firebird connection to the Medicus database.
@@ -27,6 +22,15 @@ def get_medicus_connection():
fdb.Connection object on success
None on failure
"""
if socket.gethostname().strip()=="NTBVBHP470G10":
MEDICUS_CFG = dict(
dsn=r"192.168.1.4:z:\medicus 3\data\medicus.fdb",
user="SYSDBA",
password="masterkey",
charset="win1250",
)
elif:
try:
return fdb.connect(**MEDICUS_CFG)
except fdb.fbcore.DatabaseError as e: