Re: [Tutor] pyodbc/date values in MS Access

2010-12-22 Thread Albert-Jan Roskam
ver done for us? ~~ From: Peter Otten <__pete...@web.de> To: tutor@python.org Sent: Wed, December 15, 2010 3:06:19 PM Subject: Re: [Tutor] pyodbc/date values in MS Access Albert-Jan Roskam w

Re: [Tutor] pyodbc/date values in MS Access

2010-12-15 Thread Peter Otten
Albert-Jan Roskam wrote: > Hi, > > I'm using pyodbc (Python 2.5) to insert records in an MS Access database. > For security reasons, question marks should be used for string replacement > [*]. The standard %s would make the code vulnerable to sql code injection. > Problem is, string replacement i

Re: [Tutor] pyodbc/date values in MS Access

2010-12-15 Thread Alan Gauld
"Albert-Jan Roskam" wrote dates. Below, snippet #1 does not work (Access says the inserted value is not consistent with the defined datatype), but #2 does. #2 is just normal string formatting so should always work. But the cursor method is presumabnly doing some kind of data type checking.

[Tutor] pyodbc/date values in MS Access

2010-12-15 Thread Albert-Jan Roskam
Hi, I'm using pyodbc (Python 2.5) to insert records in an MS Access database. For security reasons, question marks should be used for string replacement [*]. The standard %s would make the code vulnerable to sql code injection. Problem is, string replacement in the Good Way somehow doesn't work