[Zope] Space in column name with ZODBC

Thomas B. Passin tpassin@mitretek.org
Fri, 6 Jul 2001 10:33:34 -0400


You need to quote the names with a double quote, I believe, for the odbc
driver to use them.  I've done this in Cold Fusion for dealing with an
Access database using names with spaces.  In dtml, using quotes simply tells
Zope to evalute the quoted expression as a python expression, which isn't
quite what you want.

I think this will work although I haven't tried it (I've used it for single
quotes successfully):

column="\"Last Name\""

In other words, escape the double quote using a backslash before it.  This
escaping syntax is standard Python, and Python should proceed to create a
string with the double quotes in it.

Let us know if it works or not.

Cheers,

Tom P

[Loren Stafford]

> 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...
>