[Zope] Space in column name with ZODBC

Loren Stafford lstafford@morphics.com
Thu, 5 Jul 2001 17:58:49 -0700


I'm trying to create an ODBC interface to an existing (MSAccess) database
that has spaces in its column names. My ZSQL looks like this...

select * from "Applicant Database"
<dtml-sqlgroup where>
 <dtml-sqltest LastName op=like column="Last Name" type=string>
<dtml-and>
 <dtml-sqltest FirstName op=like column="First Name" type=string>
</dtml-sqlgroup>

...but it generates this error...

  File D:\Intranet\Zope224\lib\python\Products\ZODBCDA\db.py, line 198, in
query
sql.error: ('37000', -3100, &quot;[Microsoft][ODBC Microsoft Access Driver]
Syntax error (missing operator) in query expression '(Last Name like 'A'\012
and First Name like ''\012)'.&quot;)

There's a lot of garbage in that generated SQL, but at least I'd expect to
see the column names quoted or something. Is there a trick to it? Or am I
trying to do something impossible? Or is there a bug in ZODBC?

-- Thanks
-- Loren