in reply to Re: DBI SQL error messages
in thread DBI SQL error messages

Thanks, you're right, I was just hoping there'd be an easier way to do it from Perl itself, if you see what I mean? Having to open Access every time is a pain (esp. as I'm not very familiar with it). Looks like that's the only error message I'll get from Perl though.

I tried writing the query into Access normally and it changes it into something bizarre:

INSERT INTO tblCustomer ( LastName, BranchID, FirstName, Premise, Street, District, Town, County, PostCode ) SELECT 'a' AS Expr1, 'b' AS Expr2, 'c' AS Expr3, 'd' AS Expr4, 'e' AS Expr5, 'f' AS Expr6, 'g' AS Expr7, 'h' AS Expr8, 'i' AS Expr9;

The select thing seems slightly ridiculous. I wonder if that's just because the way the GUI works or whether Access databases themselves don't understand Values().

But anyway, that works. Thanks for your help.

Replies are listed 'Best First'.
Re^3: DBI SQL error messages
by Narveson (Chaplain) on Oct 06, 2008 at 16:36 UTC
    I wonder if that's just because the way the GUI works

    That's right. If you bypass the GUI (what Access calls Design View), you can run an INSERT ... VALUES statement against an Access database, just as DBI does.

    Ask the GUI to display what you just did, and it converts the VALUES list to a SELECT clause without a FROM clause. If you don't want to see this happen, stay in SQL view.

      Hiya, I've found out what it is actually. There's nothing wrong with my SQL, it's instead to do with how MSAccess treats its version of Text fields, which is Memo fields. For some reason it's not really compatible with DBI. There's a post about it here, although their fix didn't work for me, sadly.