widows环境下
我用pyodbc连接mssql , pyodbc版本为:pyodbc-2.1.8.win32-py2.7.exe python为:2.7
pyodbc安装到python目录成功后,连接代码如下
[code="java"]
import urllib2
from BeautifulSoup import BeautifulSoup,Tag
import re
import os
import stat
#import MySQLdb
import pyodbc
source = 'DRIVER={SQL Server};SERVER=.;DATABASE=test;UID=sa;PWD=123456'
db = pyodbc.connect(source)
cursor = db.cursor()
cursor.execute('select url,term from html_url where term="103"')
for i in cursor.fetchall():
url_str=str(i[0])
print url_str
[/code]
报错信息:
[img]http://dl.iteye.com/upload/attachment/477571/87c7fb22-72a2-3c37-a2db-e8f50a656f18.jpg[/img]
请问可能是什么原因造成的, 感激不尽