ODBC / DBI help (via Win32 Extensions)

Benjamin Schollnick junkster at nospam.rochester.rr.com
Sat Apr 29 03:38:56 EDT 2000


On Sun, 29 Apr 3900 04:49:53, "S. Hoon Yoon" <cpu at bigfoot.com> wrote:

> I think that's because you should use format #date# on update. Unless, I did
> not understand your problems.
> That's really more of SQL and access convention rather than Python.
> Pls look at the docs for Access and SQL.
> 
> UPDATE [BT Dates] SET [BT Dates].[date] = #12/12/2000#;
> 
> This is what I get if I use Query wizard and you should follow it.
> Hope it helps,

The real problem is that I can't find any documentation on the DBI 
module...

The pound convention I found out about...
Unfornately, I don't have my code with me... But...(From memory)

sql_cmd = """
		INSERT INTO logfile (datetime, loglevel,, logdata)
		VALUES ('#12/15/2000#', 1, 'test')
	"""
	# I've tried 12/15/00, 09/09/99, 09/09/1999, and a few other
	# date variants....

	# And as far as I can tell the ODBC execute command
	# appends a semicolon?  Or at least everything works
	# without having me add one...

If I attempt to execute that command, I get a SQL error from the ODBC
driver.

If I remove the datetime field and just submit using the loglevel, 
logdata
it works fine... (But that sort of defeats the purpose of a log 
file....)

The datetime field is setup in Access as a standard "Date/Time"
field, so I figure I might need to convert the datetime field into a 
dbiDate
record, but as I mentioned I can't find any instructions on the fields
&
methods for the dbiDate field(s).... (I checked the Win 32 
documentation
without any luck).

		- Benjamin	



More information about the Python-list mailing list