I am using SQL Server with Docker. I am trying to connect with pyodbc to my server but then I've got:
pyodbc.Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')
Using DBeaver I got some details:
SELECT
@@servername AS 'Server Name',
@@servicename AS 'Instance Name',
DB_NAME() AS 'Database Name',
HOST_NAME() AS 'Host Name'
and this SQL returns:
193aeb2132e4, MSSQLSERVER, model, HDZKNV2
How my connection string should looks like cause this one does not work (and I guess any variation of this)?
'DRIVER={Microsoft Access Text Driver};
SERVER=193aeb2132e4\MSSQLSERVER;
DATABASE=model;
Trusted_Connection=yes;
User=admin;
Password=passowrd'
SERVER=193aeb2132e4
but I still got same exception. Does't work forlocalhost
either. What else could be wrong? – Maciek Sienkiewicztrusted_connection
same exception occurs. damn! is there any third possible problem? I am sure I've Microsoft Access Text Driver on my machine (there are 4 more: SQL Server, ODBC Driver 17for SQL Server, Microsoft Excel Driver, Microsoft Access Driver) – Maciek SienkiewiczODBC Driver 17 for SQL Server
and changeduser
touid
, thenpassword
topwd
It seems I've got a connection now. Please move this response to a new post so I could accept this answer. – Maciek Sienkiewicz