in reply to Failure plugging table into into query

I gave your suggestions a try, but they didn't work. I guess maybe Access doesn't allow placeholders for table names. Thanks for you help anyway, guys.

Replies are listed 'Best First'.
Re: Re: Variable table
by Sifmole (Chaplain) on Jan 23, 2003 at 20:34 UTC
    Your initial question is not using a placeholder for the table name -- you are attempting to interpolate a variable to get the table name into a string which is then passed to the prepare routine. This is not working as you expect because you are using single quotes ( as stated by the previous posters ).

    Make your line look like this instead and it should work:

    $sth = $db->prepare("SELECT Names FROM $table WHERE Name = ?");
Re: Re: Variable table
by poj (Abbot) on Jan 23, 2003 at 21:29 UTC
    With Access, are you using Win32::ODBC ?
    "Programming the Perl DBI" page 169 says "Placeholders and bind parameters are not supported"
    poj