Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit d2f2122

Browse files
authored
Updating ODBC driver version reference
Also adding code comment examples of other common server connection values.
1 parent 5455eff commit d2f2122

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

docs/connect/python/pyodbc/step-3-proof-of-concept-connecting-to-sql-using-pyodbc.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ This example should be considered a proof of concept only. The sample code is s
3434
```python
3535

3636
import pyodbc
37+
# Some other example server values are
38+
# server = 'localhost\sqlexpress' # for a named instance
39+
# server = 'myserver,port' # to specify an alternate port
3740
server = 'tcp:myserver.database.windows.net'
3841
database = 'mydb'
3942
username = 'myusername'
4043
password = 'mypassword'
41-
cnxn = pyodbc.connect('DRIVER={ODBC Driver 13 for SQL Server};SERVER='+server+';DATABASE='+database+';UID='+username+';PWD='+ password)
44+
cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER='+server+';DATABASE='+database+';UID='+username+';PWD='+ password)
4245
cursor = cnxn.cursor()
4346

4447
```

0 commit comments

Comments
 (0)