1)The host would be the ip address which I can pull up through 'Ipconfig' at the CMD
2)The username and password would be the same as my windows username and password cuz im using windows authentication for sql.
3)the database would be the name of my database in sql
Under this interpretation when I run my code the IDE hangs (pythonwin)
Please advise.
(Sorry if this question is too too fundamental)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you're connecting to local SQL server, just use '.' instead of hostname or IP address.
If you intend to use Windows authentication, don't use user and password arguments; instead use trusted=True, as specified in documentation.
If it hangs, the hostname is probably not what you expect. Add some print statements before pymssql.connect to see if the values pulled up by ipconfig and others are correct.
Regards,
Andrzej
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I am trying to interpret the following line :
conn = pymssql.connect(host='SQL01', user='user', password='password', database='mydatabase')
1)The host would be the ip address which I can pull up through 'Ipconfig' at the CMD
2)The username and password would be the same as my windows username and password cuz im using windows authentication for sql.
3)the database would be the name of my database in sql
Under this interpretation when I run my code the IDE hangs (pythonwin)
Please advise.
(Sorry if this question is too too fundamental)
I don't know if I understood you correctly.
If you're connecting to local SQL server, just use '.' instead of hostname or IP address.
If you intend to use Windows authentication, don't use user and password arguments; instead use trusted=True, as specified in documentation.
If it hangs, the hostname is probably not what you expect. Add some print statements before pymssql.connect to see if the values pulled up by ipconfig and others are correct.
Regards,
Andrzej