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

Vernon Cole wnvcole at peppermillcas.com
Thu Aug 12 17:30:47 CEST 2004

mxodbc seems to be a fine product. I have never used it because it is
commercial, and my company would not be willing to cough up the bucks when
there is a GPL product available. Check out
http://sourceforge.net/projects/adodbapi .
I use adodbapi for all my database access now. Once you get past the
connection strings it can do almost anything including ODBC. (see
  For those who don't know, ADO is Microsoft's new data access method. ODBC
is Microsoft's former new data access method. (Perhaps ODBC became too
popular, so they had to invent something more obscure??)

-----Original Message-----
From: Carey David SSgt 109CF/SCBJ [mailto:David.Carey at nyscot.ang.af.mil]
Sent: Friday, August 06, 2004 10:29 AM
To: 'Andy Todd'
Cc: 'db-sig at python.org'
Subject: RE: [DB-SIG] MS SQL Server and odbc getting 'None'

Thanks for the reply. I was hoping I wouldn't need to change my code 
Around, so was avoiding mxODBC. But now looking at it, it doesn't look
like I would have to change much. I was thinking I wasn't seeing
something right, and it was my fault instead of the odbc I was using.

Well I'll give it a whirl.


-----Original Message-----
From: Andy Todd [mailto:andy47 at halfcooked.com] 
Sent: Friday, August 06, 2004 11:51 AM
To: Carey David SSgt 109CF/SCBJ
Cc: 'db-sig at python.org'
Subject: Re: [DB-SIG] MS SQL Server and odbc getting 'None'

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 -

 From the desk of Andrew J Todd esq - http://www.halfcooked.com/
DB-SIG maillist  -  DB-SIG at python.org

More information about the DB-SIG mailing list