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

Andy Todd andy47 at halfcooked.com
Fri Aug 6 17:50:57 CEST 2004


Carey David SSgt 109CF/SCBJ wrote:
> 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

The odbc module that ships with Win32All is fairly lightweight. Mark 
Hammond usually recommends that you don't use it for complex situations 
or in production type environments.

I would suggest you take a look at mxODBC - 
http://www.egenix.com/files/python/mxODBC.html

Regards,
Andy
-- 
--------------------------------------------------------------------------------
 From the desk of Andrew J Todd esq - http://www.halfcooked.com/


More information about the DB-SIG mailing list