1 #-*- coding:GBK -*-
 2 
 3 
 4 import pymssql
 5 print 'Connect to the Datebase....'
 6 
 7 conn = pymssql.connect(host='127.0.0.1' ,user='999' ,password = '',database='drp')
 8 
 9 cur = conn.cursor()
10 if not cur:
11     raise(NameError,'connect failed')
12     
13 
14 cur.execute('select * From lrkjqj')
15 
16 row = cur.fetchone()
17 print row
18 while row:
19     print row[0],row[1]
20     row = cur.fetchone()
21 conn.close()

 

相关文章:

  • 2021-11-04
  • 2022-12-23
  • 2021-05-12
  • 2022-12-23
  • 2021-12-13
  • 2021-12-18
  • 2021-12-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
相关资源
相似解决方案