Re: Column names have spaces in them!!!



I believe you want square-brackets for Access:

my $sth = $dbh->prepare("SELECT * FROM taskhours_per_date WHERE [EMPLOYEE NAME]
= ?");

Paul

Quoting Robert Hicks <sigzero@xxxxxxxxx>:

> I am using the ODBC module to talk to an Access database. In that
> database some of the column names have spaces in them (something like
> EMPLOYEE NAME).
>
> I have tried a bunch of stuff (backticking, brackets, braces, variables)
> but I cannot seem to do a select on that table.
>
> my $sth = $dbh->prepare("SELECT * FROM taskhours_per_date WHERE
> `EMPLOYEE NAME` = 'NAME HERE'" );
>
> How do I use a column name with spaces in it?!
>
> I cannot change the table name itself.
>
> Robert
>


.



Relevant Pages

  • Re: Jet Database Wont Open
    ... Paul did in ... to create the connection string and to create a Dataset. ... is stored in an Access database. ... When I use the DataAdaptor to preview the ...
    (microsoft.public.dotnet.languages.vb)
  • Re: dev connections work, test does not
    ... Hi, Paul: ... Then, because the app was failing on my test box, I thought I'd try another way, hence my efforts with odbc. ... It seems to be connecting to connection information somewhere that doesn't relate to the application. ... Can I assume that the login dialog is for the Access database and not for a linked table to another ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Merging tables when PK values are same for SOME records
    ... Paul, thanks for the suggestion. ... Here's a newb question for you: what do you mean by "create a linked ... > server to the access database. ...
    (microsoft.public.sqlserver.replication)
  • Re: Build new Access database from .NET application.
    ... Paul, ... the access database from XSD and I was hoping you was providing that. ... The data import/export ... Since he wants to export from a DataGrid the direct method would not be possible. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: pocketaccess synchronization with windows mobile 5.0
    ... Paul T. ... >I would like to synchronize an Access database with windowsw mobile 5.0 ...
    (microsoft.public.pocketpc.activesync)