Suppose I have a SQL Server installed on a Windows Server (IP: 10.0.0.1), and I want to connect the DB from an API server running on Linux (IP: 10.0.0.2):
The code above would use the driver dblib instead of sqlsrv because Medoo determines the driver to using according to the current OS with the following code:
Suppose I have a SQL Server installed on a Windows Server (IP: 10.0.0.1), and I want to connect the DB from an API server running on Linux (IP: 10.0.0.2):
The code above would use the driver
dblib
instead ofsqlsrv
because Medoo determines the driver to using according to the current OS with the following code:This is obviously wrong because the driver to use should be determined by the DB server (10.0.0.1) instead of the current server (10.0.0.2).
To solve the problem, I suggest to use either
sqlsrv
ordblib
when specify thedatabase_type
and just use the passing value in DSN string.