[DB-SIG] MS SQL Server and odbc getting 'None'

Carey David SSgt 109CF/SCBJ David.Carey at nyscot.ang.af.mil
Fri Aug 6 15:38:40 CEST 2004

Thanks for the answer on the conversion question.

I'm currently using the odbc module from Mark Hammond's Win32 extensions.


-----Original Message-----
From: Peter Mott [mailto:peter at monicol.co.uk] 
Sent: Friday, August 06, 2004 9:29 AM
To: Carey David SSgt 109CF/SCBJ
Subject: RE: [DB-SIG] MS SQL Server and odbc getting 'None'

The unicode thing is I think easy:

Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on
Type "copyright", "credits" or "license" for more information.
s = "abcd"
t = unicode(s)

Which ODBC module are you using?



> -----Original Message-----
> From: db-sig-bounces at python.org [mailto:db-sig-bounces at python.org]On
> Behalf Of Carey David SSgt 109CF/SCBJ
> Sent: 06 August 2004 14:04
> To: 'db-sig at python.org'
> Subject: [DB-SIG] MS SQL Server and odbc getting 'None'
> Hi,
>   I'm using the regular odbc (not the mxODBC) with microsoft SQL 
> Server 2000. I'm programming on windows for the platform, and 
> switching databases is not an option.
> I have been using odbc with great success. I have been receiving fine 
> from select queries, and inputting fine with insert queries, etc.
> I just have one problem. When I pull data from some tables, some 
> fields come back 'None'.
> Now I know there is data in that field. I also know that it is a 
> nvarchar type which is a unicode type. So some fields I have are 
> "regular" and others are unicode. I have no problem inserting or 
> updating to these fields, just a problem reading them. Does anyone 
> know of a way to remedy this?
> Also is there a way in Python to covert a variable holding a string to 
> a unicode type?
> For example:
> VariableXYZ = 'This is a string'
> u'VariableXYZ'
> Now I realize the above example obviously won't work, but I think it 
> illustrates what I would like to do in some instances.
> Thanks
> -Dave
> _______________________________________________
> DB-SIG maillist  -  DB-SIG at python.org
> http://mail.python.org/mailman/listinfo/db-sig

More information about the DB-SIG mailing list