I am developing a web page that will create purchase orders for me using HTML and Perl. I am using the DBI:ODBC module to interface into an Access DB that holds all the purchase order information. I am running IIS on my local machine to test and debug the code before I place it into production. My problem is this: I have a single script that cannot write to the DB. I keep getting this error:
Software error:
ERROR: [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query. (SQL-HY000)(DBD: st_execute/SQLExecute err=-1)
I know that nothing is set up wrong on my Access DB, b/c I can write to it via other scripts. The code in the script that is failing is:
######################Code Begins Below####################
#!c:\Perl\bin\perl.exe -w
use DBI;
use CGI ':standard';
use CGI::Carp qw(fatalsToBrowser);
require 'functions.lib';
print "content-type: text/html \n\n";
my $db;
$od = param('lineitemkey');
connecttodsn($db);
$sqlstmnt = $db->prepare("INSERT INTO Removals (DelID) VALUES ($od)");
$sqlstmnt->execute() or die "ERROR: $DBI::errstr\n\n";
$db->disconnect();
###############End Code####################################
I know I can read from the DB in this script b/c I have tested it with simple SELECT statements. However, I am baffled at why I cannot write to the DB, since I did it in the script before this one. I close the connection to the DB in every script (I have check multiple times). The function.lib library simple contains the connection string to the database in question.
HELP!!!!
Ben
Software error:
ERROR: [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query. (SQL-HY000)(DBD: st_execute/SQLExecute err=-1)
I know that nothing is set up wrong on my Access DB, b/c I can write to it via other scripts. The code in the script that is failing is:
######################Code Begins Below####################
#!c:\Perl\bin\perl.exe -w
use DBI;
use CGI ':standard';
use CGI::Carp qw(fatalsToBrowser);
require 'functions.lib';
print "content-type: text/html \n\n";
my $db;
$od = param('lineitemkey');
connecttodsn($db);
$sqlstmnt = $db->prepare("INSERT INTO Removals (DelID) VALUES ($od)");
$sqlstmnt->execute() or die "ERROR: $DBI::errstr\n\n";
$db->disconnect();
###############End Code####################################
I know I can read from the DB in this script b/c I have tested it with simple SELECT statements. However, I am baffled at why I cannot write to the DB, since I did it in the script before this one. I close the connection to the DB in every script (I have check multiple times). The function.lib library simple contains the connection string to the database in question.
HELP!!!!
Ben