Prev: SQL 2008 and Window 7
Next: how to extend existing entity table in db without adding new columns every time
From: Pascale Mourier on 10 Feb 2010 04:55 Hi, I am trying to port a set of Python programs originally working with PostgreSQL, to use SQL Server 2008 with Windows XP... and it is harder than expected. I tried pyodbc and ceODBC. Already read a number of documents and FAQ's. Yes I configured the Server security to allow both Windows and SQL Server logins. Is there any other admin task needed to configure the odbc interface (I assume it odbc interface ships with the SQL Server product, right?). I checked the web site www.connectionstrings.com. http://www.connectionstrings.com/sql-server-2008#p3 There are a number of choices. After some experimentation with or w/o quotes around the values of the keyword=value pairs, the closest I got to opening a connection is with pyodbc: specifying: driver={SQL Server Native Client 10.0 ODBC Driver} Is that correct? The driver complains that it expects an ASCII character and is getting a byte greater than 128... Any suggestions? Thks in advance, Pascale.
From: Erland Sommarskog on 10 Feb 2010 17:49
Pascale Mourier (Pascale.Mourier(a)ecp.fr) writes: > There are a number of choices. After some experimentation with or w/o > quotes around the values of the keyword=value pairs, the closest I got > to opening a connection is with pyodbc: > > specifying: driver={SQL Server Native Client 10.0 ODBC Driver} > > Is that correct? I don't think you have to specify the part "ODBC Driver", but I don't do very much ODBC programming myself. > The driver complains that it expects an ASCII character and is getting a > byte greater than 128... I would guess that you have a hard space, char(160) somewhere. Open your text file in a binary editor to check for values > 7E. -- Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se Links for SQL Server Books Online: SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx |