| Revision: | 8 |
| Committed: | Sat May 5 04:21:19 2012 UTC (13 years, 10 months ago) by ninoborges |
| Content type: | text/x-python |
| Original Path: | Python/NinoCode/learning/SQL_odbc.py |
| File size: | 303 byte(s) |
| Log Message: | Initial Import |
| # | User | Rev | Content |
|---|---|---|---|
| 1 | ninoborges | 8 | ## This is a file that shows how Python interacts with SQL. |
| 2 | #EBorges | ||
| 3 | #02.25.02 | ||
| 4 | |||
| 5 | import dbi | ||
| 6 | import odbc | ||
| 7 | |||
| 8 | myconn = odbc.odbc('MW_repository') | ||
| 9 | mycursor = myconn.cursor() | ||
| 10 | mycursor.execute('SELECT NetLogin, NetUDrivePath FROM Employees') | ||
| 11 | mydata = mycursor.fetchall() | ||
| 12 | mycursor.close() | ||
| 13 | myconn.close() |