URI for mssql

53 views
Skip to first unread message

Andrea Fae'

unread,
Aug 16, 2020, 5:54:18 AM8/16/20
to web2py-users
Is it correct this uri to connect to mssql server 2016?

uri       = mssql4://user:password@servername\instance/databasename

or

uri       = mssql4://user:password@servername/databasename
(without instance)

Do I have to use "/" for all separations or even "\"?

how can I be sure to use pyodbc or pypyodbc?

Thank you

T.R.Rajkumar

unread,
Aug 18, 2020, 1:18:06 AM8/18/20
to web2py-users
I use the following.
mssql2://user:pwd@servername\instance/databasename
for connecting to mssql 2016
I have my webserver apache and web2py running in windows8.
mssql in windows 2016 server.
In servername I use the IP of the machine.
In instancename I have SQL16S7INS1   --- the instance name created by me when installing mssql
In databasename I have ocms_nlc  ---- which is the database I have created in mssql
In username I give sa. You can give restricted username also if you have created one and given permission for that user to the concerned database.

Andrea Fae'

unread,
Aug 18, 2020, 3:47:52 PM8/18/20
to web2py-users
if you use mssql 2016 you maybe it's better to use this: mssql4://user:password@servername/databasename

I'm not specifying instance, and it seems working. Maybe I will try with the instance too.
thanks
Reply all
Reply to author
Forward
0 new messages