To use a file datasource, add the prefix "FILEDSN=" to the datasource name.
In that case, the name can be either an unqualified datasource name (in
which case it will be loaded from the default ODBC datasource
directory), or a fully qualified filename. If you use a fully qualified
filename, it can NOT contain a colon (:) because that is used as the
separator between the datasource and database names. Should you need to
specify a fully-qualified filename, use the UNC format to avoid the
colon. In all cases, the ".dsn" suffix is optional and can be omitted.
Examples:
; Remote file datasource
$def mss:FILEDSN=\\sharename\folder\mydsn:mydatabase|dbuser|?
; Local datasource in c:\data - use UNC format
$def mss:FILEDSN=\\sharename\c$\data\mydsn:mydatabse|dbuser|?
; This one does not work (two colons)
$def mss:FILEDSN=c:\data\mydsn:mydatabse|dbuser|?
Example content mydsn file
[ODBC]
DRIVER=ODBC Driver 17 for SQL Server
UID=worktodo
TrustServerCertificate=No
WSID=MYMACHINE
APP=Microsoft® Windows® Operating System
Trusted_Connection=No
SERVER=MYMACHINE\SQLEXPRESS2019
Description=Fildedsn using ODBC 17
Hope this helps