Re: [Tutor] ODBC SQL Server Question

2009-09-23 Thread Kristina Ambert
Hi, Thanks you guys for the replies and thanks Kent for the explanation, and yes, this: self.cursor.execute("SELECT CUSTID FROM Stories WHERE NAME= ?", (name, )) using the comma did make it work. On Fri, Sep 18, 2009 at 3:40 PM, Jeff Johnson wrote: > Thanks for the clarification Kent! > > > Ke

Re: [Tutor] ODBC SQL Server Question

2009-09-18 Thread Jeff Johnson
Thanks for the clarification Kent! Kent Johnson wrote: On Fri, Sep 18, 2009 at 2:14 PM, Jeff Johnson wrote: Kent: How about this: self.cursor.execute("SELECT CUSTID FROM Stories WHERE NAME = '%s'" % (name, )) No, that has the same result as your original. For example, In [3]: name = "Kent';

Re: [Tutor] ODBC SQL Server Question

2009-09-18 Thread Kent Johnson
On Fri, Sep 18, 2009 at 2:14 PM, Jeff Johnson wrote: > Kent: > > How about this: > self.cursor.execute("SELECT CUSTID FROM Stories WHERE NAME = '%s'" % (name, > )) No, that has the same result as your original. For example, In [3]: name = "Kent'; drop table Stories;--" In [4]: "SELECT CUSTID FRO

Re: [Tutor] ODBC SQL Server Question

2009-09-18 Thread Jeff Johnson
Kent: How about this: self.cursor.execute("SELECT CUSTID FROM Stories WHERE NAME = '%s'" % (name, )) Question, does execute know to substitute the question mark with name? self.cursor.execute("SELECT CUSTID FROM Stories WHERE NAME= ?", (name, )) TIA Kent Johnson wrote: On Fri, Sep 18, 2009

Re: [Tutor] ODBC SQL Server Question

2009-09-18 Thread Kent Johnson
On Fri, Sep 18, 2009 at 11:49 AM, Jeff Johnson wrote: > Kristina: > > I would format it as follows: > > self.cursor.execute("SELECT CUSTID FROM Stories WHERE NAME = '%s'" % name) No, that is a recipe for SQL injection attacks such as this: http://xkcd.com/327/ >> self.cursor.execute("SELECT CUST

Re: [Tutor] ODBC SQL Server Question

2009-09-18 Thread Jeff Johnson
Kristina: I would format it as follows: self.cursor.execute("SELECT CUSTID FROM Stories WHERE NAME = '%s'" % name) Kristina Ambert wrote: Hi, Is anyone familiar with this error: dbi.internal-error: [Microsoft][SQL Server Driver]Invalid cursor state in EXEC This error is triggered by the firs

[Tutor] ODBC SQL Server Question

2009-09-18 Thread Kristina Ambert
Hi, Is anyone familiar with this error: dbi.internal-error: [Microsoft][SQL Server Driver]Invalid cursor state in EXEC This error is triggered by the first sql statement call in an accessor module which purpose is only to get data from a source module and feed it into a database: self.cursor.execu

Re: [Tutor] odbc connection with python

2009-05-19 Thread Alan Gauld
"mustafa akkoc" wrote how can i make odbc connection language and i wanna make gui project after connecting database anyone has document ? There are lots of GUI options for python but if you want to do a database centred GUI and have no previous knowledge to leverage then dabo is probably y

Re: [Tutor] odbc connection with python

2009-05-19 Thread Emile van Sebille
On 5/19/2009 5:47 AM mustafa akkoc said... how can i make odbc connection language and i wanna make gui project after connecting database anyone has document ? There's an odbc module in python. I'd start with the docs on that and then google 'python odbc example' for more info and examples.

[Tutor] odbc connection with python

2009-05-19 Thread mustafa akkoc
how can i make odbc connection language and i wanna make gui project after connecting database anyone has document ? -- Mustafa Akkoc ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] odbc

2006-04-15 Thread John Corry
this what I need to log onto with python first before I access the database file? Regards, John. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Kent Johnson Sent: 15 April 2006 15:40 Cc: tutor@python.org Subject: Re: [Tutor] odbc John CORRY wrote: >

Re: [Tutor] odbc

2006-04-15 Thread Kent Johnson
John CORRY wrote: > I have just run the test package within mxODBC. I get the following result. > OperationalError: ('IM002', 0, '[Microsoft][ODBC Driver Manager] Data > source name not found and no default driver specified', 6044) > > It gives me the same error that I am experiencing when I run

[Tutor] odbc

2006-04-15 Thread John CORRY
Hi,   I have just run the test package within mxODBC.  I get the following result.   mx.ODBC Test Suite   Subpackage Name [Windows]: