[DB-SIG] MS SQL Server and odbc getting 'None'
Carey David SSgt 109CF/SCBJ
David.Carey at nyscot.ang.af.mil
Fri Aug 6 18:28:50 CEST 2004
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.
Thanks
Dave
-----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 -
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