Click to See Complete Forum and Search --> : Help! Insert statement problem


cdavis1986
09-09-2008, 03:59 PM
I am trying to do a simple insert into a Microsoft Access 2007 database. For some reason, I cannot get my query to work. All of the column names are correct. I'm using Perl to send the query as follows:

$sql = "INSERT into suppliers (currency2, bank2, tidnotice, address3, taxid, state, email, pur, buyer, payspec, taxable, accttype, ship, bank, zip, pricetab, mis, accounting, address1, type, ap, phone2, attention2)
VALUES
( 'JPY', 2983, 'Bank of Japan', 'na', 'rd', 'na', 'va', 'clay@fu.com', 98329, 'cdavis', 'Mitsuhide', 'Yes', 'No', 'savings', 389, 389, 'UPS', 'BOA', 2401, 934, 'yes', 'yes', 'daf')";


my $db = Win32::ODBC->new('support');
$db->Sql($sql);
$db->Close();


I have been trying to figure it out for the past 2 hours but for the life of me cannot figure out the problem. I thought I might be using SQL keywords in my column names by accident but I don't believe this is the case. I'm relatively sure it's not my Perl that is messing it up, because if I bring this down to only 1 or 2 parameters it works fine. Any help is welcomed!

-PS: Is there any way to directly test a query in Access 2007? I can't find it, but I find it hard to believe that they would remove such basic funtionality!

Thank you!

EDIT: Oh yeah! Also, all of the fields are TEXT with a 255 character limit. I absolutely cannot figure this out, and this is my last resort! Please help!

cdavis1986
09-10-2008, 09:37 AM
Just kidding..turns out I was using reserved words. Let this be a lesson to you all!