Hi everyone,
I'm using the Perl DBI module (DBI:ODBC) to connect to a Microsoft Access 
database, and am using SELECT FROM WHERE and LIKE commands to retrieve 
data. The table name that I need to get data from contains spaces, and some 
of the field names contain spaces and "#".
Examples:
The table name is "This Is My Table" (without the double quotes).
A field name is "Document #" (without the double quotes).

I get an error when using these names in the Perl script:
Cannot execute: [Microsoft][ODBC Microsoft Access Driver] Too few 
parameters. Expected 1. (SQL-07001)(DBD: st_execute/SQLExecute err=-1) at 
c:\art\website\home\cgi-bin\departments\htmltest.pl line 36.
This message refers to the $sth = $dbh->prepare statement which contains 
the field name with the space and "#"

This is an existing database that I would rather not touch or modify. Is 
there any special syntax or commands that would allow me to use these 
names? I used [] to enclose a field name that just had a space:
[Document Title]
That worked fine, but I tried to do the same with this one: [DOC #] and 
this did not work at all.
The [] solution did not work for the table name either.

Thanks for your help!

-George

Reply via email to