Hi,

Does anyone have any idea what is up with Microsoft Access and its ridiculous Date/Time formatting options? It doesn't seem to matter what format I attempt to insert with. The directory and db file permissions are all Full Control. I'm using the "#" around the Date/Time format as required. The database has nothing as the Format in Design view on the General tab. The insert below has never worked once. On the up side if I run an insert that has no mention of the Date/Time field then it will just insert the record using the =Now() function as the default value but that doesn't help much considering I would want to update the field. There are no question marks in any of the field names as suggested on many pages dicussing this error below. Thanks for any help! I'm using MS Access, Perl, DBI & DBD::ODBC win32 modules, IIS on XP.

Here is the error:
.......................................................................
DBD::ODBC::st execute failed: [Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect (SQL-07002)(DBD: st_execute/SQLExecute err=-1) at C:\Inetpub\Scripts\somedir\dsntest.pl line 18.
.......................................................................



Here is the code: ....................................................................... #!C:\perl\bin\perl.exe # #print "Content-type: text/html\n\n"; use DBI; # 2005-04-12 20:48:31 # 4/5/2004 5:3:45 PM # 4/12/2005 10:28:14 PM # d m yyyy h:m:s AM/PM

$dt = "#4/5/2004 5:3:45 PM#";

$sql = "INSERT INTO tblTest (TimeStamp) VALUES ($dt)";

my $dbh = DBI->connect("dbi:ODBC:dsntest", "", "", { PrintError => 0, RaiseError => 1 })
|| die "database connection can't connect to database $DBI::errstr";


my $sth = $dbh->prepare($sql) ||  die "prepare statement- $DBI::errstr";
$sth->execute() || die "execute statement- $DBI::errstr";
$sth->finish;
.......................................................................

























Reply via email to